From 12e843ed60d466e45f43e62b32176066ee645cdd Mon Sep 17 00:00:00 2001 From: yschimke Date: Fri, 16 Sep 2022 08:26:54 +0000 Subject: [PATCH] Fix tracing under offload. Currently doSomeWork is never closed and so tracing is deceiving. See https://screenshot.googleplex.com/eZDzn5APpBNnhe5 PiperOrigin-RevId: 474755816 (cherry picked from commit 06230f19c7e32728c52f71eff4243f52f534b9e1) --- RELEASENOTES.md | 1 + .../java/androidx/media3/exoplayer/ExoPlayerImplInternal.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index a01f2441e9..c747b73eb0 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -13,6 +13,7 @@ ([#10458](https://github.com/google/ExoPlayer/issues/10458)). * Discard back buffer before playback gets stuck due to insufficient available memory. + * Close the Tracing "doSomeWork" block when offload is enabled. * Downloads: * Fix potential infinite loop in `ProgressiveDownloader` caused by simultaneous download and playback with the same `PriorityTaskManager` 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 cd2ef713c2..312a9c67ae 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImplInternal.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImplInternal.java @@ -1092,7 +1092,6 @@ import java.util.concurrent.atomic.AtomicBoolean; if (sleepingForOffload || playbackInfo.playbackState == Player.STATE_ENDED) { // No need to schedule next work. - return; } else if (isPlaying || playbackInfo.playbackState == Player.STATE_BUFFERING) { // We are actively playing or waiting for data to be ready. Schedule next work quickly. scheduleNextWork(operationStartTimeMs, ACTIVE_INTERVAL_MS);