diff options
author | wm4 <wm4@nowhere> | 2013-12-10 19:32:52 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-10 20:07:39 +0100 |
commit | 5135e93d0cec05047aeced889bbf740a7d091012 (patch) | |
tree | e794fb46d5351d92cf9771b4937c9cfb6734cb24 /video/out | |
parent | e6e6b88b6da6c50bd7d7b03df583085d19427986 (diff) | |
download | mpv-5135e93d0cec05047aeced889bbf740a7d091012.tar.bz2 mpv-5135e93d0cec05047aeced889bbf740a7d091012.tar.xz |
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.)
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); } |