[PATCH] correction for libvlc to work with new vout_window_t =

Joseph Tulou brezhoneg1 at yahoo.fr
Mon Feb 2 17:34:36 CET 2009


mechanism=0A=
=0A=
---=0A=
 src/video_output/vout_intf.c |   18 +++++++++++-------=0A=
 1 files changed, 11 insertions(+), 7 deletions(-)=0A=
=0A=
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c=0A=
index 4145bde..fc53653 100644=0A=
--- a/src/video_output/vout_intf.c=0A=
+++ b/src/video_output/vout_intf.c=0A=
@@ -110,10 +110,6 @@ vout_window_t *vout_RequestWindow( vout_thread_t =
*p_vout, const char *psz_cap,=0A=
     *pi_width_hint =3D p_vout->i_window_width;=0A=
     *pi_height_hint =3D p_vout->i_window_height;=0A=
 =0A=
-    /* Check whether someone provided us with a window ID */=0A=
-    int drawable =3D var_CreateGetInteger( p_vout, "drawable" );=0A=
-    if( drawable ) return (void *)(intptr_t)drawable;=0A=
-=0A=
     vout_window_t *wnd =3D vlc_custom_create (VLC_OBJECT(p_vout), =
sizeof (*wnd),=0A=
                                             VLC_OBJECT_GENERIC, =
"window");=0A=
     if (wnd =3D=3D NULL)=0A=
@@ -126,6 +122,14 @@ vout_window_t *vout_RequestWindow( vout_thread_t =
*p_vout, const char *psz_cap,=0A=
     wnd->pos_y =3D *pi_y_hint;=0A=
     vlc_object_attach (wnd, p_vout);=0A=
 =0A=
+    /* Check whether someone provided us with a window ID */=0A=
+    int drawable =3D var_CreateGetInteger( p_vout, "drawable" );=0A=
+    if( drawable )=0A=
+    {=0A=
+        wnd->handle.hwnd =3D (intptr_t)drawable;=0A=
+        return wnd;=0A=
+    } =0A=
+=0A=
     wnd->module =3D module_need (wnd, psz_cap, NULL, false);=0A=
     if (wnd->module =3D=3D NULL)=0A=
     {=0A=
@@ -150,15 +154,15 @@ void vout_ReleaseWindow( vout_window_t *wnd )=0A=
     if (wnd =3D=3D NULL)=0A=
         return;=0A=
 =0A=
-    assert (wnd->module);=0A=
-    module_unneed (wnd, wnd->module);=0A=
+    if (wnd->module)=0A=
+        module_unneed (wnd, wnd->module);=0A=
 =0A=
     vlc_object_release (wnd);=0A=
 }=0A=
 =0A=
 int vout_ControlWindow( vout_window_t *wnd, int i_query, va_list args )=0A=
 {=0A=
-    if (wnd =3D=3D NULL)=0A=
+    if (wnd =3D=3D NULL || wnd->control =3D=3D NULL)=0A=
         return VLC_EGENERIC;=0A=
 =0A=
     assert (wnd->control);=0A=
-- =0A=
1.5.2.5=0A=
=0A=

------=_NextPart_000_0001_01C9855F.161E1F70--




More information about the vlc-devel mailing list