Skip to content

Commit 3a4987a

Browse files
Googlercopybara-github
authored andcommitted
Fix offload playback readiness and presentation end handling.
In DefaultAudioSink, only mark offload presentation as handled if the audio output has actually stopped. This prevents `hasPendingData` from returning false prematurely during offloaded playlist playback. PiperOrigin-RevId: 882123651
1 parent a401e35 commit 3a4987a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio/DefaultAudioSink.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,13 @@ public void onOffloadPresentationEnded() {
19391939
// Stale event.
19401940
return;
19411941
}
1942-
handledOffloadOnPresentationEnded = true;
1942+
// Without checking `stoppedAudioOutput`, during playlist playback with offloaded audio,
1943+
// `hasPendingData` could return false prematurely. We only update
1944+
// `handledOffloadOnPresentationEnded` to true if the audio output has actually finished
1945+
// playing.
1946+
if (stoppedAudioOutput) {
1947+
handledOffloadOnPresentationEnded = true;
1948+
}
19431949
}
19441950

19451951
@Override

0 commit comments

Comments
 (0)