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.
This commit is contained in:
wm4 2014-05-07 21:41:14 +02:00
parent eada87853e
commit 725e956b11
1 changed files with 1 additions and 1 deletions

View File

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