mirror of
https://github.com/mpv-player/mpv
synced 2025-03-09 15:47:44 +00:00
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:
parent
eada87853e
commit
725e956b11
@ -1128,7 +1128,7 @@ void run_playloop(struct MPContext *mpctx)
|
|||||||
// choice, since the frame rate could be unset/broken/random.
|
// choice, since the frame rate could be unset/broken/random.
|
||||||
float fps = mpctx->d_video->fps;
|
float fps = mpctx->d_video->fps;
|
||||||
double frame_duration = fps > 0 ? 1.0 / fps : 0;
|
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) {
|
if (pts2 != MP_NOPTS_VALUE) {
|
||||||
// expected A/V sync correction is ignored
|
// expected A/V sync correction is ignored
|
||||||
|
Loading…
Reference in New Issue
Block a user