summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-17 05:52:36 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-17 17:05:42 +0300
commitdecec7f2a37e559d6a05a01e8c916908c13d5dcb (patch)
tree5bd51b19b47237ae1bec77c50da05dd913fc55d2
parentc3e46833c22f1e9ca7de55105881131d00129707 (diff)
downloadmpv-decec7f2a37e559d6a05a01e8c916908c13d5dcb.tar.bz2
mpv-decec7f2a37e559d6a05a01e8c916908c13d5dcb.tar.xz
vo_vdpau: skip resize code if not fully initialized
Window events or user commands could trigger a call to resize() before config() had been called. This caused at least error messages. Add a check to make resize() exit without doing anything in this case. It will be called again later when the output is configured.
-rw-r--r--libvo/vo_vdpau.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c
index f9710b7a1e..6fb32b442b 100644
--- a/libvo/vo_vdpau.c
+++ b/libvo/vo_vdpau.c
@@ -371,6 +371,10 @@ static void resize(struct vo *vo)
struct vdp_functions *vdp = vc->vdp;
VdpStatus vdp_st;
int i;
+
+ if (!vo->config_ok || vc->is_preempted)
+ return;
+
struct vo_rect src_rect;
struct vo_rect dst_rect;
struct vo_rect borders;
@@ -931,6 +935,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
if ((flags & VOFLAG_FULLSCREEN) && WinID <= 0)
vo_fs = 1;
+ vo->config_ok = true; // set temporarily as resize() checks it below
if (initialize_vdpau_objects(vo) < 0)
return -1;