Release decoded data back to the buffer pool

This commit is contained in:
Cameron Gutman 2013-11-10 03:58:48 -05:00
parent 34e87ca899
commit ab61af0cb7
2 changed files with 8 additions and 1 deletions

View File

@ -150,6 +150,8 @@ public class NvAudioStream {
}
track.write(samples.data, samples.offset, samples.length);
depacketizer.releaseBuffer(samples);
}
}
}).start();

View File

@ -32,7 +32,7 @@ public class AvAudioDepacketizer {
{
System.out.println("Received OOS audio data (expected "+(lastSequenceNumber + 1)+", got "+seq+")");
// Tell the decoder about this
// Tell the decoder about this packet loss
//OpusDecoder.decode(null, 0, 0, null);
}
@ -54,6 +54,11 @@ public class AvAudioDepacketizer {
}
}
public void releaseBuffer(AvShortBufferDescriptor decodedData)
{
pool.free(decodedData.data);
}
public AvShortBufferDescriptor getNextDecodedData() throws InterruptedException
{
return decodedUnits.take();