]> git.sesse.net Git - vlc/commitdiff
Corrects crashing when a skin doesn't have a video widget.
authorJoseph Tulou <brezhoneg1@yahoo.fr>
Wed, 18 Feb 2009 15:57:55 +0000 (16:57 +0100)
committerJean-Baptiste Kempf <jb@sasmira.jbkempf.com>
Fri, 20 Feb 2009 13:20:14 +0000 (14:20 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@sasmira.jbkempf.com>
modules/gui/qt4/qt4.cpp
modules/gui/skins2/src/skin_main.cpp

index 15a8f88822958f3c63fdb488219be7d18cc5bd45..3d4cda2d380e25fff9549990fe53f19cf1248aae 100644 (file)
@@ -293,9 +293,12 @@ static int Open( vlc_object_t *p_this )
 
     while( p_sys->p_mi == NULL && !p_sys->b_isDialogProvider )
         iface.ready.wait( &iface.lock );
-    var_Create (p_this->p_libvlc, "qt4-iface", VLC_VAR_ADDRESS);
-    val.p_address = p_this;
-    var_Set (p_this->p_libvlc, "qt4-iface", val);
+    if( !p_sys->b_isDialogProvider )
+    {
+        var_Create (p_this->p_libvlc, "qt4-iface", VLC_VAR_ADDRESS);
+        val.p_address = p_this;
+        var_Set (p_this->p_libvlc, "qt4-iface", val);
+    }
     return VLC_SUCCESS;
 }
 
index a116e75f6d7c3a45bc24ac52780b08042136025b..be5bb554726d52ebc0447251fd585ce9deb2e3ac 100644 (file)
@@ -305,12 +305,18 @@ static int WindowOpen( vlc_object_t *p_this )
     pWnd->handle.hwnd = VlcProc::getWindow( pIntf, pWnd->vout,
                                        &pWnd->pos_x, &pWnd->pos_y,
                                        &pWnd->width, &pWnd->height );
-    pWnd->p_private = pIntf;
-    pWnd->control = &VlcProc::controlWindow;
-    return VLC_SUCCESS;
+    if( pWnd->handle.hwnd )
+    {
+        pWnd->p_private = pIntf;
+        pWnd->control = &VlcProc::controlWindow;
+        return VLC_SUCCESS;
+    }
+    else
+    {
+        return VLC_EGENERIC;
+    }
 }
 
-
 static void WindowClose( vlc_object_t *p_this )
 {
     vout_window_t *pWnd = (vout_window_t *)p_this;