From 624c9e46ce0bb4f547ffaf9cd6541700cea96ddb Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 13 Nov 2015 22:42:42 +0100 Subject: player: always require a future frame with display-sync enabled We need a frame duration even on start, because the number of vsyncs the frame is shown is predetermined. (vo_opengl actually makes use of this property in certain cases.) --- player/video.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/player/video.c b/player/video.c index 0aebc6a7e9..430fed530e 100644 --- a/player/video.c +++ b/player/video.c @@ -611,10 +611,14 @@ static void shift_frames(struct MPContext *mpctx) static int get_req_frames(struct MPContext *mpctx, bool eof) { // 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) + if (eof) return 1; + // On the first frame, output a new frame as quickly as possible. + // But display-sync likes to have a correct frame duration always. + if (mpctx->video_pts == MP_NOPTS_VALUE) + return mpctx->opts->video_sync == VS_DEFAULT ? 1 : 2; + int req = vo_get_num_req_frames(mpctx->video_out); return MPCLAMP(req, 2, MP_ARRAY_SIZE(mpctx->next_frames)); } -- cgit v1.2.3