[vlc-devel] commit: Corrects crashing when a skin doesn't have a video widget. ( Joseph Tulou )

git version control git at videolan.org
Fri Feb 20 14:22:54 CET 2009


vlc | branch: master | Joseph Tulou <brezhoneg1 at yahoo.fr> | Wed Feb 18 16:57:55 2009 +0100| [a8291189ab6f75e859e934b884faa53b4770873a] | committer: Jean-Baptiste Kempf 

Corrects crashing when a skin doesn't have a video widget.

Signed-off-by: Jean-Baptiste Kempf <jb at sasmira.jbkempf.com>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a8291189ab6f75e859e934b884faa53b4770873a
---

 modules/gui/qt4/qt4.cpp              |    9 ++++++---
 modules/gui/skins2/src/skin_main.cpp |   14 ++++++++++----
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 15a8f88..3d4cda2 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -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;
 }
 
diff --git a/modules/gui/skins2/src/skin_main.cpp b/modules/gui/skins2/src/skin_main.cpp
index a116e75..be5bb55 100644
--- a/modules/gui/skins2/src/skin_main.cpp
+++ b/modules/gui/skins2/src/skin_main.cpp
@@ -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;




More information about the vlc-devel mailing list