mirror of
https://github.com/samsonjs/media.git
synced 2026-04-13 12:35:48 +00:00
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
This commit is contained in:
parent
ed5ec4e8a8
commit
7af95230cb
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue