1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 01:22:30 +00:00

video: trust container FPS early on if possible

If the container FPS is correct, this can help getting ideal mix factors
for vo_gpu interpolation mode. Otherwise, it doesn't matter.
This commit is contained in:
wm4 2018-05-10 16:49:50 +02:00
parent cc2490ea7e
commit 0354e7c599

View File

@ -955,7 +955,8 @@ static void calculate_frame_duration(struct MPContext *mpctx)
// Note that even if each timestamp is within rounding tolerance, it
// could literally not add up (e.g. if demuxer FPS is rounded itself).
if (fabs(duration - demux_duration) < tolerance &&
fabs(total - demux_duration * num_dur) < tolerance && num_dur >= 16)
fabs(total - demux_duration * num_dur) < tolerance &&
(num_dur >= 16 || num_dur >= mpctx->num_past_frames - 4))
{
approx_duration = demux_duration;
}