]> git.sesse.net Git - vlc/commitdiff
Use pl_Yield instead of vlc_object_find
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 1 Jun 2008 08:16:10 +0000 (11:16 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 1 Jun 2008 08:16:10 +0000 (11:16 +0300)
modules/gui/qt4/main_interface.cpp

index f94855bda8d576b29b6fe93ad8a03325b6ea09f0..6a98a24831e5b5c1c5a76f57d970f52225024ece 100644 (file)
@@ -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 );