Commit 79708f43 by Martin Bonnin

handle the case when flushCodec() is called while reiniting the decoders

parent e8a8c49a
......@@ -493,9 +493,10 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
decodeOnlyPresentationTimestamps.clear();
// Workaround for framework bugs.
// See [Internal: b/8347958], [Internal: b/8578467], [Internal: b/8543366].
if (Util.SDK_INT >= 18) {
if (Util.SDK_INT >= 18 && codecReinitState == REINIT_STATE_NONE) {
codec.flush();
} else {
codecReinitState = REINIT_STATE_NONE;
releaseCodec();
maybeInitCodec();
}
......@@ -504,6 +505,8 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
// avoid this issue by sending reconfiguration data following every flush.
codecReconfigurationState = RECONFIGURATION_STATE_WRITE_PENDING;
}
hasQueuedOneInputBuffer = false;
}
/**
......
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