1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00

video: always decode at least 2 frames in advance

Remove the exception for decoding only 1 frame if VO framedrop is
disabled. This was originally done to be able to test potential
regressions when we enabled VO framedrop and decoding 2 frames by
default. It's not needed anymore.
This commit is contained in:
wm4 2015-07-26 20:56:37 +02:00
parent 77a9265561
commit 1e91750c73

View File

@ -600,17 +600,13 @@ static void shift_frames(struct MPContext *mpctx)
static int get_req_frames(struct MPContext *mpctx, bool eof)
{
struct MPOpts *opts = mpctx->opts;
// On EOF, drain all frames.
// On the first frame, output a new frame as quickly as possible.
if (eof || mpctx->video_pts == MP_NOPTS_VALUE)
return 1;
int req = vo_get_num_req_frames(mpctx->video_out);
if (opts->frame_dropping & 1)
req = MPMAX(req, 2);
return MPMIN(req, MP_ARRAY_SIZE(mpctx->next_frames));
return MPCLAMP(req, 2, MP_ARRAY_SIZE(mpctx->next_frames));
}
// Whether it's fine to call add_new_frame() now.