From eb8a57ee4678713f0b0ea5c8252f231d0046fe58 Mon Sep 17 00:00:00 2001 From: tonihei Date: Tue, 17 Nov 2020 18:27:27 +0000 Subject: [PATCH] Only notify rebuffer to if we are actually rebuffering. Right now we also notify while we are paused although this doesn't classify as a rebuffer. PiperOrigin-RevId: 342892667 --- .../com/google/android/exoplayer2/ExoPlayerImplInternal.java | 2 +- .../google/android/exoplayer2/LivePlaybackSpeedControl.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java index fde6869d2d..445dafdf78 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java @@ -993,8 +993,8 @@ import java.util.concurrent.atomic.AtomicBoolean; setState(Player.STATE_BUFFERING); if (isRebuffering) { notifyTrackSelectionRebuffer(); + livePlaybackSpeedControl.notifyRebuffer(); } - livePlaybackSpeedControl.notifyRebuffer(); stopRenderers(); } diff --git a/library/core/src/main/java/com/google/android/exoplayer2/LivePlaybackSpeedControl.java b/library/core/src/main/java/com/google/android/exoplayer2/LivePlaybackSpeedControl.java index 6796185edd..1ffdc82457 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/LivePlaybackSpeedControl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/LivePlaybackSpeedControl.java @@ -44,7 +44,8 @@ public interface LivePlaybackSpeedControl { * Notifies the live playback speed control that a rebuffer occurred. * *

A rebuffer is defined to be caused by buffer depletion rather than a user action. Hence this - * method is not called during initial or when buffering as a result of a seek operation. + * method is not called during initial buffering or when buffering as a result of a seek + * operation. */ void notifyRebuffer();