]> git.sesse.net Git - vlc/blobdiff - src/playlist/thread.c
The last but not least of this serie of memleaks.
[vlc] / src / playlist / thread.c
index 2e1b70d3bd9009fd16843b4a35cb834b4075f8f8..33f2861ec6eeb9cb2276f1a62023271e628ca15c 100644 (file)
@@ -140,9 +140,7 @@ static void RunControlThread ( playlist_t *p_playlist )
     vlc_object_lock( p_playlist );
     while( vlc_object_alive( p_playlist ) )
     {
-        PL_UNLOCK;
         playlist_MainLoop( p_playlist );
-        PL_LOCK;
 
         /* The playlist lock has been unlocked, so we can't tell if
          * someone has killed us in the meantime. Check now. */
@@ -152,9 +150,11 @@ static void RunControlThread ( playlist_t *p_playlist )
         if( p_playlist->b_cant_sleep )
         {
             /* 100 ms is an acceptable delay for playlist operations */
-            PL_UNLOCK;
+            vlc_object_unlock( p_playlist );
+
             msleep( INTF_IDLE_SLEEP*2 );
-            PL_LOCK;
+
+            vlc_object_lock( p_playlist );
         }
         else
         {