From 5135e93d0cec05047aeced889bbf740a7d091012 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 10 Dec 2013 19:32:52 +0100 Subject: vo: reset some fields properly Otherwise, next_pts2 can be == next_pts (and not MP_NOPTS_VALUE), in which case the player thinks the first frame has duration 0. (Weird corner case.) --- video/out/vo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/video/out/vo.c b/video/out/vo.c index dc17a2bbb6..578fc18fd0 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -165,6 +165,8 @@ static struct vo *vo_create(struct mpv_global *global, .event_fd = -1, .registered_fd = -1, .aspdat = { .monitor_par = 1 }, + .next_pts = MP_NOPTS_VALUE, + .next_pts2 = MP_NOPTS_VALUE, }; if (vo->driver->encode != !!vo->encode_lavc_ctx) goto error; @@ -197,6 +199,7 @@ void vo_queue_image(struct vo *vo, struct mp_image *mpi) } vo->frame_loaded = true; vo->next_pts = mpi->pts; + vo->next_pts2 = MP_NOPTS_VALUE; assert(!vo->waiting_mpi); vo->waiting_mpi = mp_image_new_ref(mpi); } @@ -265,6 +268,7 @@ void vo_flip_page(struct vo *vo, unsigned int pts_us, int duration) if (!vo->redrawing) { vo->frame_loaded = false; vo->next_pts = MP_NOPTS_VALUE; + vo->next_pts2 = MP_NOPTS_VALUE; } vo->want_redraw = false; vo->redrawing = false; @@ -290,6 +294,8 @@ void vo_seek_reset(struct vo *vo) { vo_control(vo, VOCTRL_RESET, NULL); vo->frame_loaded = false; + vo->next_pts = MP_NOPTS_VALUE; + vo->next_pts2 = MP_NOPTS_VALUE; vo->hasframe = false; mp_image_unrefp(&vo->waiting_mpi); } -- cgit v1.2.3