Free audio packets back to the packet pool after decoding.

This commit is contained in:
Cameron Gutman 2013-11-12 02:19:58 -05:00
parent 4eaf68ae58
commit aa4e07ea2f
2 changed files with 7 additions and 1 deletions

View File

@ -170,8 +170,9 @@ public class NvAudioStream {
return; return;
} }
// !!! We no longer own the data buffer at this point !!!
depacketizer.decodeInputData(packet); depacketizer.decodeInputData(packet);
pool.free(packet.getBackingBuffer());
} }
} }
}; };

View File

@ -34,6 +34,11 @@ public class AvRtpPacket {
return seqNum; return seqNum;
} }
public byte[] getBackingBuffer()
{
return buffer.data;
}
public AvByteBufferDescriptor getNewPayloadDescriptor() public AvByteBufferDescriptor getNewPayloadDescriptor()
{ {
return new AvByteBufferDescriptor(buffer.data, buffer.offset+12, buffer.length-12); return new AvByteBufferDescriptor(buffer.data, buffer.offset+12, buffer.length-12);