mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +00: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
2 changed files with 9 additions and 0 deletions
|
|
@ -35,6 +35,10 @@
|
|||
* Audio:
|
||||
* Fix DTS:X Profile 2 encoding attributes for passthrough playback
|
||||
([#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:
|
||||
* Text:
|
||||
* Fix issue where subtitles starting before a seek position are skipped.
|
||||
|
|
|
|||
|
|
@ -1869,6 +1869,11 @@ public final class DefaultAudioSink implements AudioSink {
|
|||
if (!stoppedAudioTrack) {
|
||||
stoppedAudioTrack = true;
|
||||
audioTrackPositionTracker.handleEndOfStream(getWrittenFrames());
|
||||
if (isOffloadedPlayback(audioTrack)) {
|
||||
// Reset handledOffloadOnPresentationEnded to track completion after
|
||||
// this following stop call.
|
||||
handledOffloadOnPresentationEnded = false;
|
||||
}
|
||||
audioTrack.stop();
|
||||
bytesUntilNextAvSync = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue