mirror of
https://github.com/mpv-player/mpv.git
synced 2026-06-06 20:10:30 +00:00
player: sync audio as well when enabling it mid-stream
If an audio track is enabled during playback, then make it resume at the exact "current position", instead of playing audio before that position. This was already done for video.
This commit is contained in:
@@ -671,6 +671,9 @@ static bool get_sync_samples(struct MPContext *mpctx, int *skip)
|
||||
} else if (mpctx->hrseek_active) {
|
||||
sync_pts = mpctx->hrseek_pts;
|
||||
}
|
||||
// If the audio is enabled mid-stream during playback, sync accordingly.
|
||||
if (sync_pts == MP_NOPTS_VALUE)
|
||||
sync_pts = mpctx->playback_pts;
|
||||
if (sync_pts == MP_NOPTS_VALUE) {
|
||||
mpctx->audio_status = STATUS_FILLING;
|
||||
return true; // syncing disabled
|
||||
|
||||
Reference in New Issue
Block a user