]> git.sesse.net Git - vlc/blobdiff - modules/codec/cmml/intf.c
Use pl_Locked and pl_Unlocked.
[vlc] / modules / codec / cmml / intf.c
index 1ecfbf0a409b32be67b2db3bc6131e86ab007cb6..5f58b303d318a92b075c96c3d08d84d46f685ef6 100644 (file)
@@ -189,10 +189,10 @@ static void RunIntf( intf_thread_t *p_intf )
 #endif
 
     /* Main loop */
-    while( !p_intf->b_die )
+    while( vlc_object_alive (p_intf) )
     {
         /* if video output is dying, disassociate ourselves from it */
-        if( p_vout && p_vout->b_die )
+        if( p_vout && !vlc_object_alive (p_vout) )
         {
             var_DelCallback( p_vout, "mouse-clicked", MouseEvent, p_intf );
             vlc_object_release( p_vout );
@@ -334,7 +334,7 @@ static int DisplayPendingAnchor( intf_thread_t *p_intf, vout_thread_t *p_vout )
 static int InitThread( intf_thread_t * p_intf )
 {
     /* We might need some locking here */
-    if( !p_intf->b_die )
+    if( vlc_object_alive (p_intf) )
     {
         input_thread_t * p_input;
         decoder_t *p_cmml_decoder;
@@ -435,13 +435,7 @@ static void FollowAnchor ( intf_thread_t *p_intf )
         mtime_t i_seconds;
         vlc_value_t time;
 
-        p_playlist = (playlist_t *) vlc_object_find( p_intf,
-                VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-        if ( !p_playlist )
-        {
-            msg_Warn( p_intf, "can't find playlist" );
-            return;
-        }
+        p_playlist = pl_Yield( p_intf );
 
         /* Get new URL */
         p_current_item = p_playlist->status.p_item;
@@ -516,7 +510,7 @@ static void FollowAnchor ( intf_thread_t *p_intf )
             msg_Dbg( p_intf, "calling browser_Open with \"%s\"", psz_url );
 #endif
             (void) browser_Open( psz_url );
-            playlist_Control( p_playlist, PLAYLIST_PAUSE, true, 0 );
+            playlist_Control( p_playlist, PLAYLIST_PAUSE, pl_Unlocked, 0 );
         }
 
         free( psz_uri_to_load );
@@ -644,13 +638,7 @@ void GoBack( intf_thread_t *p_intf )
 #endif
 
     /* Find the playlist */
-    p_playlist = (playlist_t *) vlc_object_find( p_intf,
-            VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-    if ( !p_playlist )
-    {
-        msg_Warn( p_intf, "can't find playlist" );
-        return;
-    }
+    p_playlist = pl_Yield( p_intf );
 
     /* Retrieve navigation history from playlist */
     if( var_Get( p_playlist, "navigation-history", &history ) != VLC_SUCCESS ||
@@ -722,13 +710,7 @@ void GoForward( intf_thread_t *p_intf )
 #endif
 
     /* Find the playlist */
-    p_playlist = (playlist_t *) vlc_object_find( p_intf,
-            VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-    if ( !p_playlist )
-    {
-        msg_Warn( p_intf, "can't find playlist" );
-        return;
-    }
+    p_playlist = pl_Yield( p_intf );
 
     /* Retrieve navigation history from playlist */
     if( var_Get( p_playlist, "navigation-history", &history ) != VLC_SUCCESS ||