Skip to content

Commit

Permalink
Make MediaCodecTrackRenderer discard non-keyframes after seek.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ojw28 committed Sep 8, 2014
1 parent 5059690 commit 5d35698
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ protected final void maybeInitCodec() throws ExoPlaybackException {
}
codecHotswapTimeMs = getState() == TrackRenderer.STATE_STARTED ?
SystemClock.elapsedRealtime() : -1;
inputIndex = -1;
outputIndex = -1;
waitingForFirstSyncFrame = true;
inputIndex = -1;
outputIndex = -1;
waitingForFirstSyncFrame = true;
codecCounters.codecInitCount++;
}

Expand Down Expand Up @@ -449,6 +449,7 @@ private void flushCodec() throws ExoPlaybackException {
codecHotswapTimeMs = -1;
inputIndex = -1;
outputIndex = -1;
waitingForFirstSyncFrame = true;
decodeOnlyPresentationTimestamps.clear();
// Workaround for framework bugs.
// See [redacted], [redacted], [redacted].
Expand Down

0 comments on commit 5d35698

Please sign in to comment.