mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +00:00
Allow pause if in offload mode after writing all buffers
In offload mode, `AudioTrack#stop()` will put the track in `PLAYSTATE_STOPPING` rather than `PLAYSTATE_STOPPED`. The difference in state means that `AudioTrack` can be paused and played during this 'stopping' period. Currently, if `AudioTrackPositionTracker#handleEndOfStream()` has been called then `DefaultAudioSink` in `pause()` won't call `AudioTrack#pause()`. `AudioTrack#pause()` should be called in this case if in offload mode. #minor-release PiperOrigin-RevId: 571335108
This commit is contained in:
parent
272428734b
commit
ab42d64d6d
1 changed files with 2 additions and 1 deletions
|
|
@ -1407,7 +1407,8 @@ public final class DefaultAudioSink implements AudioSink {
|
|||
@Override
|
||||
public void pause() {
|
||||
playing = false;
|
||||
if (isAudioTrackInitialized() && audioTrackPositionTracker.pause()) {
|
||||
if (isAudioTrackInitialized()
|
||||
&& (audioTrackPositionTracker.pause() || isOffloadedPlayback(audioTrack))) {
|
||||
audioTrack.pause();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue