From dd339b200be99ecac1a0bb4a7509b338120c5bce Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 26 Sep 2016 17:55:00 +0200 Subject: video: trust demuxer framerate on invalid timestamps If the PTS goes backwards (whether it's a timestamp reset or some other problem) would just use 0 as frame duration. (At least until the logic for detecting divergence with the timestamps gets active.) Trust the demuxer framerate in these cases instead, if it's available. I think this improves behavior slightly with some broken files. --- player/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index ca207fb6aa..69128025b7 100644 --- a/player/video.c +++ b/player/video.c @@ -1288,7 +1288,7 @@ static void calculate_frame_duration(struct MPContext *mpctx) double demux_duration = mpctx->vo_chain->container_fps > 0 ? 1.0 / mpctx->vo_chain->container_fps : -1; - double duration = -1; + double duration = demux_duration; if (mpctx->num_next_frames >= 2) { double pts0 = mpctx->next_frames[0]->pts; -- cgit v1.2.3