Skip to content

Commit

Permalink
Fix for google issue google#9347 and our WSIPCL11050 (google#170)
Browse files Browse the repository at this point in the history
Once the MaskingMediaPeriod completes `prepare()` (when the masked HlsMediaPeriod reports the first real Timeline with a duration and window start position) it should not use it again.

The bug is a track selection causes a jump to live if you are at position 0 in the timeline, even after playback was started from the live point (the prepare position override).
  • Loading branch information
stevemayhew authored Sep 2, 2021
1 parent 05d9ee2 commit 109232e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,6 @@ public long selectTracks(
@NullableType SampleStream[] streams,
boolean[] streamResetFlags,
long positionUs) {
if (preparePositionOverrideUs != C.TIME_UNSET && positionUs == preparePositionUs) {
positionUs = preparePositionOverrideUs;
preparePositionOverrideUs = C.TIME_UNSET;
}
return castNonNull(mediaPeriod)
.selectTracks(selections, mayRetainStreamFlags, streams, streamResetFlags, positionUs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ protected void onChildSourceInfoRefreshed(
@Nullable MediaPeriodId idForMaskingPeriodPreparation = null;
if (isPrepared) {
timeline = timeline.cloneWithUpdatedTimeline(newTimeline);
if (unpreparedMaskingMediaPeriod != null) {
// Reset override in case the duration changed and we need to update our override.
setPreparePositionOverrideToUnpreparedMaskingPeriod(
unpreparedMaskingMediaPeriod.getPreparePositionOverrideUs());
}
} else if (newTimeline.isEmpty()) {
timeline =
hasRealTimeline
Expand Down

0 comments on commit 109232e

Please sign in to comment.