Commit 7af95230 by christosts Committed by Andrew Lewis

DebugMediaCodecVideoRenderer: expect output format change after flush

The DebugMediaCodecVideoRenderer expects the MediaCodec to return an
output format change after the MediaCodecRenderer detects an input
format change, but the DebugMediaCodecVideoRenderer resets its state
after flushing MediaCodec. This does not cover the following case: an
input format change is detected when queueing sample with timestamp X
and before the respective output buffer is dequeued, the player seeks
back to X. After seeking back to X, the MCR does not trigger an input
format change for X again, and MediaCodec (correctly) returns an output
format change before dequeueing output X.

This commit is changing DebugMediaCodecVideoRenderer to keep expecting
an output format change after a flush, is one a format pending output.
Such an an edge-case is addressed already in MediaCodecRenderer.

PiperOrigin-RevId: 370482506
parent ed5ec4e8
......@@ -140,10 +140,11 @@ import java.util.ArrayList;
protected void resetCodecStateForFlush() {
super.resetCodecStateForFlush();
clearTimestamps();
// Check if there is a format change on the input side still pending propagation to the
// output.
inputFormatChanged = !inputFormatChangeTimesUs.isEmpty();
inputFormatChangeTimesUs.clear();
inputFormatChanged = false;
outputMediaFormatChanged = false;
currentMediaFormat = null;
}
@Override
......
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