mirror of
https://github.com/mpv-player/mpv
synced 2025-03-22 03:08:33 +00:00
player: resync audio only on larger timestamp discontinuities
Helps with files that have occasional broken timestamps. For larger discontinuities, e.g. caused by actual timestamp resets, we still want to realign audio. (I guess in general, this should be removed and replaced by a more general resync-on-desync logic, but not now.)
This commit is contained in:
parent
f626bef7c8
commit
68c6da69f7
@ -579,9 +579,9 @@ static void handle_new_frame(struct MPContext *mpctx)
|
||||
// Assume a discontinuity.
|
||||
MP_WARN(mpctx, "Invalid video timestamp: %f -> %f\n",
|
||||
mpctx->video_pts, pts);
|
||||
frame_time = 0;
|
||||
if (mpctx->d_audio)
|
||||
if (mpctx->d_audio && fabs(frame_time) > 1.0)
|
||||
mpctx->audio_status = STATUS_SYNCING;
|
||||
frame_time = 0;
|
||||
}
|
||||
}
|
||||
mpctx->video_next_pts = pts;
|
||||
|
Loading…
Reference in New Issue
Block a user