diff options
author | wm4 <wm4@nowhere> | 2015-12-04 16:55:55 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-04 16:55:55 +0100 |
commit | 68c6da69f79b3c1ac781df56a63b3aeb0621fa47 (patch) | |
tree | 66c0bfba9cf0ebcf095dc628222ea61139ee273d /player | |
parent | f626bef7c8320c6937e7b8f8a725e13e8f59773c (diff) | |
download | mpv-68c6da69f79b3c1ac781df56a63b3aeb0621fa47.tar.bz2 mpv-68c6da69f79b3c1ac781df56a63b3aeb0621fa47.tar.xz |
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.)
Diffstat (limited to 'player')
-rw-r--r-- | player/video.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/player/video.c b/player/video.c index 91899dc451..563e573eb7 100644 --- a/player/video.c +++ b/player/video.c @@ -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; |