Commit 21dd59ba by andrewlewis Committed by bachinger

Don't try to track buffersInCodec with tunneling

PiperOrigin-RevId: 283551324
parent 6c10c94f
...@@ -763,7 +763,11 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -763,7 +763,11 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
@CallSuper @CallSuper
@Override @Override
protected void onQueueInputBuffer(DecoderInputBuffer buffer) { protected void onQueueInputBuffer(DecoderInputBuffer buffer) {
buffersInCodecCount++; // In tunneling mode the device may do frame rate conversion, so in general we can't keep track
// of the number of buffers in the codec.
if (!tunneling) {
buffersInCodecCount++;
}
lastInputTimeUs = Math.max(buffer.timeUs, lastInputTimeUs); lastInputTimeUs = Math.max(buffer.timeUs, lastInputTimeUs);
if (Util.SDK_INT < 23 && tunneling) { if (Util.SDK_INT < 23 && tunneling) {
// In tunneled mode before API 23 we don't have a way to know when the buffer is output, so // In tunneled mode before API 23 we don't have a way to know when the buffer is output, so
...@@ -1008,7 +1012,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -1008,7 +1012,9 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
@CallSuper @CallSuper
@Override @Override
protected void onProcessedOutputBuffer(long presentationTimeUs) { protected void onProcessedOutputBuffer(long presentationTimeUs) {
buffersInCodecCount--; if (!tunneling) {
buffersInCodecCount--;
}
while (pendingOutputStreamOffsetCount != 0 while (pendingOutputStreamOffsetCount != 0
&& presentationTimeUs >= pendingOutputStreamSwitchTimesUs[0]) { && presentationTimeUs >= pendingOutputStreamSwitchTimesUs[0]) {
outputStreamOffsetUs = pendingOutputStreamOffsetsUs[0]; outputStreamOffsetUs = pendingOutputStreamOffsetsUs[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment