1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 09:02:38 +00:00

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.
This commit is contained in:
Uoti Urpala 2011-07-17 05:52:36 +03:00
parent c3e46833c2
commit decec7f2a3

View File

@ -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;