diff options
author | wm4 <wm4@nowhere> | 2014-05-07 21:41:14 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-07 21:41:14 +0200 |
commit | 725e956b1116d401844453e26846202ba5989608 (patch) | |
tree | 1ff82b4ef4029ac27834d98b2de2e6e546ce8824 /player | |
parent | eada87853eddca71c7d5c7ca4d7c842e10f312ea (diff) | |
download | mpv-725e956b1116d401844453e26846202ba5989608.tar.bz2 mpv-725e956b1116d401844453e26846202ba5989608.tar.xz |
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.
Diffstat (limited to 'player')
-rw-r--r-- | player/playloop.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 |