[vlc-commits] commit: Qt4: change main interface mode from the UI thread ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun May 30 17:02:43 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 30 17:37:12 2010 +0300| [8abd25d4f52c23e6c19f40740e3aaafc385c0e73] | committer: Rémi Denis-Courmont 

Qt4: change main interface mode from the UI thread

This presumptively fixes a probable race condition. For the umpteenth
time, never ever make any Qt4 UI call from the video output thread!!

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

 modules/gui/qt4/main_interface.cpp |   12 +++++++++---
 modules/gui/qt4/main_interface.hpp |    1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index add973c..3fd3741 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -211,7 +211,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
         if( b_autoresize )
         {
             CONNECT( this, askVideoToResize( unsigned int, unsigned int ),
-                     videoWidget, SetSizing( unsigned int, unsigned int ) );
+                     this, setVideoSize( unsigned int, unsigned int ) );
             CONNECT( videoWidget, sizeChanged( int, int ),
                      this, resizeStack( int,  int ) );
         }
@@ -589,6 +589,13 @@ void MainInterface::releaseVideoSlot( void )
     stackCentralOldWidget = bgWidget;
 }
 
+void MainInterface::setVideoSize( unsigned int w, unsigned int h )
+{
+    if( isFullScreen() || isMaximized() )
+        showNormal();
+    videoWidget->SetSizing( w, h );
+}
+
 /* Slot to change the video always-on-top flag.
  * Emit askVideoOnTop() to invoke this from other thread. */
 void MainInterface::setVideoOnTop( bool on_top )
@@ -616,8 +623,7 @@ int MainInterface::controlVideo( int i_query, va_list args )
     {
         unsigned int i_width  = va_arg( args, unsigned int );
         unsigned int i_height = va_arg( args, unsigned int );
-        if( isFullScreen() || isMaximized() )
-            showNormal();
+
         emit askVideoToResize( i_width, i_height );
         return VLC_SUCCESS;
     }
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 28c852e..e629c51 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -214,6 +214,7 @@ private slots:
             else resize( size() - stackCentralW->size() + QSize( w, h ) );
         debug(); }
 
+    void setVideoSize( unsigned int, unsigned int );
     void setVideoOnTop( bool );
 
 signals:



More information about the vlc-commits mailing list