]> git.sesse.net Git - vlc/commitdiff
Factor and fix locking
authorRémi Denis-Courmont <remi@remlab.net>
Fri, 6 Mar 2009 16:14:36 +0000 (18:14 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Fri, 6 Mar 2009 16:15:36 +0000 (18:15 +0200)
src/control/playlist.c

index 794c137d172a8caaeef7076f2b822b0eaddec4be..4f354addb36fb46e6b287f34e6c1df428fcfd044 100644 (file)
@@ -81,21 +81,15 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
 
         p_item = playlist_ItemGetByInputId( PL, i_id,
                                             PL->p_root_category );
-        if( !p_item )
-        {
-            if( did_lock == 1 )
-            {
-                playlist_Unlock( PL );
-                playlist_mark_locked( p_instance, 0 );
-            }
+        if( p_item )
+            playlist_Control( PL, PLAYLIST_VIEWPLAY, pl_Locked,
+                              PL->p_root_category, p_item );
+       else
             RAISEVOID( "Unable to find item" );
-        }
 
-        playlist_Control( PL, PLAYLIST_VIEWPLAY, pl_Locked,
-                          PL->p_root_category, p_item );
         if( did_lock == 1 )
         {
-            playlist_Lock( PL );
+            playlist_Unlock( PL );
             playlist_mark_locked( p_instance, 0 );
         }
     }