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

This commit is contained in:
Martin Bonnin 2015-01-22 10:24:51 +01:00
parent e8a8c49a97
commit 79708f43f8

View file

@ -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;
}
/**