summaryrefslogtreecommitdiffstats
path: root/player/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-13 22:42:42 +0100
committerwm4 <wm4@nowhere>2015-11-13 22:42:42 +0100
commit624c9e46ce0bb4f547ffaf9cd6541700cea96ddb (patch)
treeaa098de773ad759fef0dd77e1b68ac2755175c52 /player/video.c
parentf0feea55918e133ba3e6871e2bb1cbd9610cb2d1 (diff)
downloadmpv-624c9e46ce0bb4f547ffaf9cd6541700cea96ddb.tar.bz2
mpv-624c9e46ce0bb4f547ffaf9cd6541700cea96ddb.tar.xz
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.)
Diffstat (limited to 'player/video.c')
-rw-r--r--player/video.c8
1 files 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));
}