[vlc-commits] Qt: factor some common code

Rémi Denis-Courmont git at videolan.org
Wed Jul 4 20:20:37 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul  4 20:47:52 2012 +0300| [35e5155af388d74c41c13782b82d793343828c95] | committer: Rémi Denis-Courmont

Qt: factor some common code

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

 modules/gui/qt4/qt4.cpp |   20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 4bb338e..988dbec 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -623,25 +623,19 @@ static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
     unsigned i_width = cfg->width;
     unsigned i_height = cfg->height;
 
-#if defined (Q_WS_X11)
-    p_wnd->handle.xid = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
-    if( !p_wnd->handle.xid )
+    WId wid = p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
+    if( !wid )
         return VLC_EGENERIC;
+#if defined (Q_WS_X11)
+    p_wnd->handle.xid = wid;
     p_wnd->display.x11 = NULL;
-
-#elif defined (Q_WS_WIN) || defined(Q_WS_PM)
-    p_wnd->handle.hwnd = (void *)p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
-    if( !p_wnd->handle.hwnd )
-        return VLC_EGENERIC;
-
+#elif defined (Q_WS_WIN) || defined (Q_WS_PM)
+    p_wnd->handle.hwnd = (void *)wid;
 #elif defined (Q_WS_MAC)
-    p_wnd->handle.nsobject = (void *)p_mi->getVideo( &i_x, &i_y, &i_width, &i_height );
-    if( !p_wnd->handle.nsobject )
-        return VLC_EGENERIC;
+    p_wnd->handle.nsobject = (void *)wid;
 #else
 # error FIXME
 #endif
-
     p_wnd->control = WindowControl;
     p_wnd->sys = (vout_window_sys_t*)p_mi;
     return VLC_SUCCESS;



More information about the vlc-commits mailing list