mirror of
https://github.com/samsonjs/media.git
synced 2026-04-01 10:35:48 +00:00
Fix wrong output timestamp in seeking
Set `VideoSink`'s offset during seeking in `MCVR.onPositionReset()` This one is necessary in some cases, where `onProcessedStreamChange()` is not invoked during a seek. For example, when seeking when playback has ended. PiperOrigin-RevId: 630056723
This commit is contained in:
parent
d059e97b28
commit
2e3c3eb678
1 changed files with 1 additions and 1 deletions
|
|
@ -652,6 +652,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
|||
// Flush the video sink first to ensure it stops reading textures that will be owned by
|
||||
// MediaCodec once the codec is flushed.
|
||||
videoSink.flush();
|
||||
videoSink.setStreamOffsetUs(getOutputStreamOffsetUs());
|
||||
super.onPositionReset(positionUs, joining);
|
||||
videoFrameReleaseControl.reset();
|
||||
if (joining) {
|
||||
|
|
@ -1098,7 +1099,6 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
|||
// Pass a direct executor since the callback handling involves posting on the app looper
|
||||
// again, so there's no need to do two hops.
|
||||
directExecutor());
|
||||
videoSink.setStreamOffsetUs(getOutputStreamOffsetUs());
|
||||
}
|
||||
hasInitializedPlayback = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue