From d292f809265f2fa886da36d5f7f2e033eb4ed365 Mon Sep 17 00:00:00 2001 From: bachinger Date: Mon, 29 Apr 2024 04:03:43 -0700 Subject: [PATCH] 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 --- .../java/androidx/media3/exoplayer/ExoPlayerImplInternal.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImplInternal.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImplInternal.java index d0aa961107..5236a4cd1e 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImplInternal.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImplInternal.java @@ -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); } }