Commit 1495b9a4 by olly Committed by Oliver Woodman

Fix stuck playback when media has uneven track end times

* Always assume a renderer is ready if it's read to the end of
  its current stream and there's a subsequent period already
  prepared. This prevents getting stuck when a non-clock renderer
  has a short stream.
* Switch to the standalone clock if the renderer providing the
  media clock has read to the end of its current stream, is no
  longer ready, and there's a subsequent period already prepared.
  This prevents getting stuck when a clock renderer has a short
  stream.
* Remove unnecessary clock synchronization logic (since it would
  need to be made more complicated as a result of this change).
* Don't update the playing period holder when playWhenReady is
  false. This avoids the position jumping to the start of the
  next period when seeking to the very end of the current period
  whilst paused (we still end up showing the first frame of video
  from the next period, but fixing that will have to wait).

Github: #1874

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170717481
parent 7e7fea40
......@@ -69,16 +69,6 @@ public final class StandaloneMediaClock implements MediaClock {
}
}
/**
* Synchronizes this clock with the current state of {@code clock}.
*
* @param clock The clock with which to synchronize.
*/
public void synchronize(MediaClock clock) {
setPositionUs(clock.getPositionUs());
playbackParameters = clock.getPlaybackParameters();
}
@Override
public long getPositionUs() {
long positionUs = baseUs;
......
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