[vlc-devel] commit: Remove superfluous locking ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Jun 22 15:24:43 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Jun 22 16:26:02 2008 +0300| [6059d32eaba8a12fe2b84d78780456e978fdc208]

Remove superfluous locking

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

 modules/gui/qt4/components/interface_widgets.cpp |   11 -----------
 modules/gui/qt4/components/interface_widgets.hpp |    5 -----
 2 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 171ef65..1256f4b 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -47,7 +47,6 @@
 #include <QPalette>
 #include <QResizeEvent>
 #include <QDate>
-#include <QMutexLocker>
 #ifdef Q_WS_X11
 # include <X11/Xlib.h>
 # include <qx11info_x11.h>
@@ -63,7 +62,6 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
     /* Init */
     vlc_mutex_init( &lock );
     p_vout = NULL;
-    handleReady = false;
     hide(); setMinimumSize( 16, 16 );
     videoSize.rwidth() = -1;
     videoSize.rheight() = -1;
@@ -93,9 +91,6 @@ void VideoWidget::paintEvent(QPaintEvent *ev)
 #ifdef Q_WS_X11
     XFlush( QX11Info::display() );
 #endif
-    QMutexLocker locker( &handleLock );
-    handleReady = true;
-    handleWait.wakeAll();
 }
 
 VideoWidget::~VideoWidget()
@@ -124,7 +119,6 @@ VideoWidget::~VideoWidget()
 void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
                            unsigned int *pi_width, unsigned int *pi_height )
 {
-    QMutexLocker locker( &handleLock );
     msg_Dbg( p_intf, "Video was requested %i, %i", *pi_x, *pi_y );
     emit askVideoWidgetToShow();
     if( p_vout )
@@ -133,11 +127,6 @@ void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
         return NULL;
     }
     p_vout = p_nvout;
-    while( !handleReady )
-    {
-        msg_Dbg( p_intf, "embedded video pending (handle %p)", winId() );
-        handleWait.wait( &handleLock );
-    }
     msg_Dbg( p_intf, "embedded video ready (handle %p)", winId() );
     return ( void* )winId();
 }
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index efa76ec..ed629ac 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -40,8 +40,6 @@
 
 #include <QWidget>
 #include <QFrame>
-#include <QMutex>
-#include <QWaitCondition>
 
 #define VOLUME_MAX 200
 
@@ -91,9 +89,6 @@ private:
 
     vlc_mutex_t lock;
     QSize videoSize;
-    QMutex         handleLock;
-    QWaitCondition handleWait;
-    bool           handleReady;
 
 signals:
     void askVideoWidgetToShow();




More information about the vlc-devel mailing list