Skip to content

Commit

Permalink
Fix maskingX variables when timeline becomes empty
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164840037
  • Loading branch information
ojw28 committed Aug 10, 2017
1 parent 88bae5d commit 1b28d83
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,12 @@ public Object getCurrentManifest() {
case ExoPlayerImplInternal.MSG_SEEK_ACK: {
if (--pendingSeekAcks == 0) {
playbackInfo = (ExoPlayerImplInternal.PlaybackInfo) msg.obj;
if (timeline.isEmpty()) {
// Update the masking variables, which are used when the timeline is empty.
maskingPeriodIndex = 0;
maskingWindowIndex = 0;
maskingWindowPositionMs = 0;
}
if (msg.arg1 != 0) {
for (Player.EventListener listener : listeners) {
listener.onPositionDiscontinuity();
Expand All @@ -472,6 +478,12 @@ public Object getCurrentManifest() {
timeline = sourceInfo.timeline;
manifest = sourceInfo.manifest;
playbackInfo = sourceInfo.playbackInfo;
if (pendingSeekAcks == 0 && timeline.isEmpty()) {
// Update the masking variables, which are used when the timeline is empty.
maskingPeriodIndex = 0;
maskingWindowIndex = 0;
maskingWindowPositionMs = 0;
}
for (Player.EventListener listener : listeners) {
listener.onTimelineChanged(timeline, manifest);
}
Expand Down

0 comments on commit 1b28d83

Please sign in to comment.