From d0e6dec19988becc9ab0ae1e7fe1a8ccdee548c5 Mon Sep 17 00:00:00 2001 From: ibaker Date: Wed, 16 Dec 2020 13:06:31 +0000 Subject: [PATCH] Fix EPI.seekTo to balance operation acks when seeking during an ad This regression was introduced in https://github.com/google/ExoPlayer/commit/b1e9257de143e9f377895b63868ef47b4fc0eea9 Issue: #8349 PiperOrigin-RevId: 347802049 --- RELEASENOTES.md | 3 +++ .../java/com/google/android/exoplayer2/ExoPlayerImpl.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 5324ba62ed..c2ee9d6562 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -2,6 +2,9 @@ ### 2.12.3 (???-??-??) ### +* Core library: + * Fix playback issues after seeking during an ad + ([#8349](https://github.com/google/ExoPlayer/issues/8349)). * UI: * Fix issue where pop-up menus belonging to `StyledPlayerControlView` would not be dismissed when tapping outside of the menu area or pressing diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java index 377863a083..17463b3cd1 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java @@ -601,8 +601,10 @@ import java.util.concurrent.TimeoutException; // general because the midroll ad preceding the seek destination must be played before the // content position can be played, if a different ad is playing at the moment. Log.w(TAG, "seekTo ignored because an ad is playing"); - playbackInfoUpdateListener.onPlaybackInfoUpdate( - new ExoPlayerImplInternal.PlaybackInfoUpdate(playbackInfo)); + ExoPlayerImplInternal.PlaybackInfoUpdate playbackInfoUpdate = + new ExoPlayerImplInternal.PlaybackInfoUpdate(this.playbackInfo); + playbackInfoUpdate.incrementPendingOperationAcks(1); + playbackInfoUpdateListener.onPlaybackInfoUpdate(playbackInfoUpdate); return; } @Player.State