From 725e956b1116d401844453e26846202ba5989608 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 7 May 2014 21:41:14 +0200 Subject: player: limit max. fallback frame duration It's calculated from the demuxer reported FPS, which is not very reliable. Limit the damage a completely insane and broken value could cause. --- player/playloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player') diff --git a/player/playloop.c b/player/playloop.c index fbe0f416ba..0531cd3e06 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -1128,7 +1128,7 @@ void run_playloop(struct MPContext *mpctx) // choice, since the frame rate could be unset/broken/random. float fps = mpctx->d_video->fps; double frame_duration = fps > 0 ? 1.0 / fps : 0; - pts2 = mpctx->video_pts + frame_duration; + pts2 = mpctx->video_pts + MPCLAMP(frame_duration, 0.0, 5.0); } if (pts2 != MP_NOPTS_VALUE) { // expected A/V sync correction is ignored -- cgit v1.2.3