mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Reset tracker for offload track completion prior to stopping AudioTrack
For offloaded playback, reset the tracking field for stream completion in `DefaultAudioSink` prior to calling `AudioTrack.stop()` so that `AudioTrack.StreamEventCallback#onPresentationEnded` correctly identifies when all pending data has been played. #minor-release PiperOrigin-RevId: 631744805
This commit is contained in:
parent
9adb532b6c
commit
ab64ca809a
@ -35,6 +35,10 @@
|
|||||||
* Audio:
|
* Audio:
|
||||||
* Fix DTS:X Profile 2 encoding attributes for passthrough playback
|
* Fix DTS:X Profile 2 encoding attributes for passthrough playback
|
||||||
([#1299](https://github.com/androidx/media/pull/1299)).
|
([#1299](https://github.com/androidx/media/pull/1299)).
|
||||||
|
* For offloaded playback, reset the tracking field for stream completion
|
||||||
|
in `DefaultAudioSink` prior to calling `AudioTrack.stop()` so that
|
||||||
|
`AudioTrack.StreamEventCallback#onPresentationEnded` correctly
|
||||||
|
identifies when all pending data has been played.
|
||||||
* Video:
|
* Video:
|
||||||
* Text:
|
* Text:
|
||||||
* Fix issue where subtitles starting before a seek position are skipped.
|
* Fix issue where subtitles starting before a seek position are skipped.
|
||||||
|
@ -1869,6 +1869,11 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
if (!stoppedAudioTrack) {
|
if (!stoppedAudioTrack) {
|
||||||
stoppedAudioTrack = true;
|
stoppedAudioTrack = true;
|
||||||
audioTrackPositionTracker.handleEndOfStream(getWrittenFrames());
|
audioTrackPositionTracker.handleEndOfStream(getWrittenFrames());
|
||||||
|
if (isOffloadedPlayback(audioTrack)) {
|
||||||
|
// Reset handledOffloadOnPresentationEnded to track completion after
|
||||||
|
// this following stop call.
|
||||||
|
handledOffloadOnPresentationEnded = false;
|
||||||
|
}
|
||||||
audioTrack.stop();
|
audioTrack.stop();
|
||||||
bytesUntilNextAvSync = 0;
|
bytesUntilNextAvSync = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user