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:
wm4 2015-12-04 16:55:55 +01:00
parent f626bef7c8
commit 68c6da69f7
1 changed files with 2 additions and 2 deletions

View File

@ -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;