Fix issue with updating the last rebuffer time

The last rebuffer time was being updated erroneously, even in the absence of rebuffering events, resulting in incorrect `bs` (buffer starvation) key in CMCD.

Issue: androidx/media#1124
PiperOrigin-RevId: 629731796
This commit is contained in:
rohks 2024-05-01 08:32:52 -07:00 committed by Copybara-Service
parent e25bd07a81
commit feb512544a
2 changed files with 4 additions and 1 deletions

View File

@ -13,6 +13,9 @@
* Add `ExoPlayer.setPriority` (and `Builder.setPriority`) to define the * Add `ExoPlayer.setPriority` (and `Builder.setPriority`) to define the
priority value used in `PriorityTaskManager` and for MediaCodec priority value used in `PriorityTaskManager` and for MediaCodec
importance from API 35. importance from API 35.
* Fix issue with updating the last rebuffer time which resulted in
incorrect `bs` (buffer starvation) key in CMCD
([#1124](https://github.com/androidx/media/issues/1124)).
* Transformer: * Transformer:
* Work around a decoder bug where the number of audio channels was capped * Work around a decoder bug where the number of audio channels was capped
at stereo when handling PCM input. at stereo when handling PCM input.

View File

@ -3019,7 +3019,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
private void updateRebufferingState(boolean isRebuffering, boolean resetLastRebufferRealtimeMs) { private void updateRebufferingState(boolean isRebuffering, boolean resetLastRebufferRealtimeMs) {
this.isRebuffering = isRebuffering; this.isRebuffering = isRebuffering;
this.lastRebufferRealtimeMs = this.lastRebufferRealtimeMs =
resetLastRebufferRealtimeMs ? C.TIME_UNSET : clock.elapsedRealtime(); isRebuffering && !resetLastRebufferRealtimeMs ? clock.elapsedRealtime() : C.TIME_UNSET;
} }
/** /**