Update audio renderer position before pausing
As part of pausing DefaultAudioSink, its position-related fields are reset. If the audio timestamp API was in use, this results in falling back to the getPlaybackHeadPosition API, which (on some devices) can lead to a jump in the reported position. Sample the position before pausing instead of after, to avoid this jump. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=189713376
This commit is contained in:
parent
99959d6130
commit
aad5927a2b
@ -393,8 +393,8 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
|
||||
|
||||
@Override
|
||||
protected void onStopped() {
|
||||
audioSink.pause();
|
||||
updateCurrentPosition();
|
||||
audioSink.pause();
|
||||
super.onStopped();
|
||||
}
|
||||
|
||||
|
@ -522,8 +522,8 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
|
||||
|
||||
@Override
|
||||
protected void onStopped() {
|
||||
audioSink.pause();
|
||||
updateCurrentPosition();
|
||||
audioSink.pause();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user