[vlc-devel] commit: Use pl_Yield instead of vlc_object_find ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Jun 1 10:14:30 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Jun  1 11:16:10 2008 +0300| [ca797b1332660646ac7c8f0cec481782433726ae]

Use pl_Yield instead of vlc_object_find

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

 modules/gui/qt4/main_interface.cpp |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index f94855b..6a98a24 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -223,14 +223,10 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     p_intf->b_interaction = true;
 
     /* Register callback for the intf-popupmenu variable */
-    playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
-                                        VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-    if( p_playlist != NULL )
-    {
-        var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
-        var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
-        vlc_object_release( p_playlist );
-    }
+    playlist_t *p_playlist = pl_Yield( p_intf );
+    var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
+    var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
+    pl_Release( p_intf );
 
     /* VideoWidget connect mess to avoid different threads speaking to each other */
     CONNECT( this, askReleaseVideo( void * ),
@@ -289,14 +285,10 @@ MainInterface::~MainInterface()
     delete settings;
 
     /* Unregister callback for the intf-popupmenu variable */
-    playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
-                                        VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-    if( p_playlist != NULL )
-    {
-        var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
-        var_DelCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
-        vlc_object_release( p_playlist );
-    }
+    playlist_t *p_playlist = pl_Yield( p_intf );
+    var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
+    var_DelCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
+    pl_Release( p_intf );
 
     p_intf->b_interaction = false;
     var_DelCallback( p_intf, "interaction", InteractCallback, this );




More information about the vlc-devel mailing list