diff options
author | wm4 <wm4@nowhere> | 2012-10-21 15:54:22 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-24 21:56:34 +0200 |
commit | f80a32a8ebd1573f1578d707416b07880c1a08c1 (patch) | |
tree | 908845c81c04e393ce28beef519f6f6cfedc47ea /libvo/video_out.c | |
parent | 0c49ddc818fee8059d764f7fbd25820584f335a3 (diff) | |
download | mpv-f80a32a8ebd1573f1578d707416b07880c1a08c1.tar.bz2 mpv-f80a32a8ebd1573f1578d707416b07880c1a08c1.tar.xz |
core: do not try to redraw OSD if VO doesn't support OSD
This fixes awkward framestepping when seeking with -vo null while paused
(caused because seeking by default draws an OSD bar, and mplayer trying
to redraw the OSD in that case; this logic is actually needed with
vo_xv).
It would have been simpler to just check vo->driver->draw_osd (and leave
that callback to NULL for VOs which don't support OSD), but for now try
to retain the capability to let VOs decide based on the image format
whether to support OSD or not.
Diffstat (limited to 'libvo/video_out.c')
-rw-r--r-- | libvo/video_out.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c index 2503fa93e3..c16968574d 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -38,6 +38,7 @@ #include "mp_fifo.h" #include "m_config.h" #include "mp_msg.h" +#include "libmpcodecs/vfcap.h" #include "osdep/shmem.h" #ifdef CONFIG_X11 @@ -224,9 +225,8 @@ void vo_new_frame_imminent(struct vo *vo) void vo_draw_osd(struct vo *vo, struct osd_state *osd) { - if (!vo->config_ok) - return; - vo->driver->draw_osd(vo, osd); + if (vo->config_ok && (vo->default_caps & VFCAP_OSD)) + vo->driver->draw_osd(vo, osd); } void vo_flip_page(struct vo *vo, unsigned int pts_us, int duration) @@ -385,10 +385,14 @@ int vo_config(struct vo *vo, uint32_t width, uint32_t height, vo->dheight = d_height; } + vo->default_caps = vo_control(vo, VOCTRL_QUERY_FORMAT, &format); + int ret = vo->driver->config(vo, width, height, d_width, d_height, flags, format); vo->config_ok = (ret == 0); vo->config_count += vo->config_ok; + if (!vo->config_ok) + vo->default_caps = 0; if (vo->registered_fd == -1 && vo->event_fd != -1 && vo->config_ok) { mp_input_add_key_fd(vo->input_ctx, vo->event_fd, 1, event_fd_callback, NULL, vo); |