From: Rafaël Carré Date: Fri, 12 Oct 2007 18:43:02 +0000 (+0000) Subject: qt4: do not access a widget from another thread X-Git-Tag: 0.9.0-test0~5063 X-Git-Url: http://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=commitdiff_plain;h=48785825906a724ea80bf3936bcf45ba2f012a4b qt4: do not access a widget from another thread --- diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp index 1725545896..3841ee0938 100644 --- a/modules/gui/qt4/components/interface_widgets.cpp +++ b/modules/gui/qt4/components/interface_widgets.cpp @@ -57,6 +57,7 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i ) vlc_mutex_init( p_intf, &lock ); p_vout = NULL; CONNECT( this, askResize(), this, SetMinSize() ); + CONNECT( this, askVideoToShow(), this, show() ); setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); } @@ -88,7 +89,7 @@ QSize VideoWidget::sizeHint() const void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y, unsigned int *pi_width, unsigned int *pi_height ) { - show(); + emit askVideoToShow(); if( p_vout ) { msg_Dbg( p_intf, "embedded video already in use" ); diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp index 8e747ce9b6..85dc19d83f 100644 --- a/modules/gui/qt4/components/interface_widgets.hpp +++ b/modules/gui/qt4/components/interface_widgets.hpp @@ -66,6 +66,7 @@ private: vlc_mutex_t lock; signals: void askResize(); + void askVideoToShow(); private slots: void SetMinSize(); };