Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 31 additions & 7 deletions src/org/jitsi/impl/neomedia/codec/video/vp8/DePacketizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,23 @@ protected int doProcess(Buffer inBuffer, Buffer outBuffer)
= VP8PayloadDescriptor.isStartOfFrame(inData, inOffset);
int inLength = inBuffer.getLength();
int inPdSize = VP8PayloadDescriptor.getSize(inData, inOffset);
// handle when inbuffer is empty.
if (inLength < 1)
{
if (logger.isDebugEnabled())
{
logger.debug("inBuffer is empty");
}
outBuffer.setDiscard(true);
return BUFFER_PROCESSED_OK;
}
//TODO handle VP8PayloadDescriptor returning invalid.
int inPayloadLength = inLength - inPdSize;
if (logger.isTraceEnabled())
{
logger.trace("inPayload length " + inPayloadLength + " inLength " +
inLength);
}

if (empty
&& lastSentSeq != -1
Expand Down Expand Up @@ -384,13 +400,21 @@ protected int doProcess(Buffer inBuffer, Buffer outBuffer)
for (Map.Entry<Long, Container> entry : data.entrySet())
{
b = entry.getValue();
System.arraycopy(
b.buf,
0,
outData,
ptr,
b.len);
ptr += b.len;
try
{
System.arraycopy(
b.buf,
0,
outData,
ptr,
b.len);
ptr += b.len;
}
catch (Exception e)
{
// ensure frameLength 0 on copy failure
frameLength = 0;
}
}

outBuffer.setOffset(0);
Expand Down