summaryrefslogtreecommitdiffstats
path: root/video/out/vo.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-24 23:28:38 +0100
committerwm4 <wm4@nowhere>2015-01-24 23:28:38 +0100
commit8657b8e1f3c247dcba441a4c61e3beef2acc2cd4 (patch)
tree2ff77ed69d755a27c647edd6a46afe4b024b60e8 /video/out/vo.c
parent28582322207bb962553505f0c25268f4b786287d (diff)
downloadmpv-8657b8e1f3c247dcba441a4c61e3beef2acc2cd4.tar.bz2
mpv-8657b8e1f3c247dcba441a4c61e3beef2acc2cd4.tar.xz
vo: generic redraw support
Usually, a VO must react to VOCTRL_REDRAW_FRAME in order to redraw the current screen correctly if video is paused (this is done to update OSD). But if it's not supported, we can just draw the current image again in the generic vo.c code. Unfortunately, this turned out pretty useless, because the VOs which would benefit from this need to redraw even if there is no image, in order to draw a black screen in --idle --force-window mode. The way redrawing is handled in the X11 common code and in vo_x11 and vo_xv is in the way, and I'm not sure what exactly vo_wayland requires. Other VOs have a non-trivial implementation of VOCTRL_REDRAW_FRAME, which (probably) makes redrawing slightly more efficient, e.g. by skipping texture upload. So for now, no VO uses this new functionality, but since it's trivial, commit it anyway. The vo_driver->untimed case is for forcibly disabling redraw for vo_lavc and vo_image always.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r--video/out/vo.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 11690afb67..aee2dd8c75 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -687,9 +687,9 @@ static void do_redraw(struct vo *vo)
pthread_mutex_lock(&in->lock);
in->request_redraw = false;
in->want_redraw = false;
- bool force_full_redraw = in->dropped_frame;
+ bool full_redraw = in->dropped_frame;
struct mp_image *img = NULL;
- if (vo->config_ok)
+ if (vo->config_ok && !(vo->driver->untimed))
img = mp_image_new_ref(in->current_frame);
if (img)
in->dropped_frame = false;
@@ -698,12 +698,10 @@ static void do_redraw(struct vo *vo)
if (!img)
return;
- if (force_full_redraw) {
+ if (full_redraw || vo->driver->control(vo, VOCTRL_REDRAW_FRAME, NULL) < 1) {
vo->driver->draw_image(vo, img);
} else {
talloc_free(img);
- if (vo->driver->control(vo, VOCTRL_REDRAW_FRAME, NULL) < 1)
- return;
}
if (vo->driver->flip_page_timed)