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.
This commit is contained in:
wm4 2016-09-26 17:55:00 +02:00
parent e6dedbcc23
commit dd339b200b
1 changed files with 1 additions and 1 deletions

View File

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