Remove MSG_DO_SOME_WORK when requesting playlist update

This removes a window of inconsistency between the timeline
known to the player and the most recent timeline in the
`MediaSourceList` by removing the `MSG_DO_SOME_WORK` when
sending `MSG_PLAYLIST_UPDATE_REQUESTED`. `MSG_DO_SOME_WORK`
is then sent again when the playlist update is requested.

PiperOrigin-RevId: 629021752
This commit is contained in:
bachinger 2024-04-29 04:03:43 -07:00 committed by Copybara-Service
parent 7089253bef
commit d292f80926

View file

@ -483,6 +483,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
@Override
public void onPlaylistUpdateRequested() {
handler.removeMessages(MSG_DO_SOME_WORK);
handler.sendEmptyMessage(MSG_PLAYLIST_UPDATE_REQUESTED);
}
@ -2060,6 +2061,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
pendingInitialSeekPosition = null;
}
handleLoadingMediaPeriodChanged(/* loadingTrackSelectionChanged= */ false);
handler.sendEmptyMessage(MSG_DO_SOME_WORK);
}
}