Make MediaCodecTrackRenderer discard non-keyframes after seek.
This means that after a decoder flush, the renderer will avoid feeding non-keyframes into the decoder until it has received and fed the first keyframe. The decoder has no way of correctly decoding non-keyframes that arrive before a keyframe.
This commit is contained in:
parent
5059690a7a
commit
5d35698d8f
@ -283,9 +283,9 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
|
||||
}
|
||||
codecHotswapTimeMs = getState() == TrackRenderer.STATE_STARTED ?
|
||||
SystemClock.elapsedRealtime() : -1;
|
||||
inputIndex = -1;
|
||||
outputIndex = -1;
|
||||
waitingForFirstSyncFrame = true;
|
||||
inputIndex = -1;
|
||||
outputIndex = -1;
|
||||
waitingForFirstSyncFrame = true;
|
||||
codecCounters.codecInitCount++;
|
||||
}
|
||||
|
||||
@ -449,6 +449,7 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
|
||||
codecHotswapTimeMs = -1;
|
||||
inputIndex = -1;
|
||||
outputIndex = -1;
|
||||
waitingForFirstSyncFrame = true;
|
||||
decodeOnlyPresentationTimestamps.clear();
|
||||
// Workaround for framework bugs.
|
||||
// See [redacted], [redacted], [redacted].
|
||||
|
Loading…
x
Reference in New Issue
Block a user