]> git.sesse.net Git - vlc/blobdiff - src/playlist/engine.c
Fix CDDA and a corner-case in playlist handling
[vlc] / src / playlist / engine.c
index 2d81f6fe3c990542cadaf30e3d9134c4ef8f479b..a094dbb42616520f813773a28884d00d91c7ac59 100644 (file)
@@ -28,8 +28,6 @@
 #include "vlc_playlist.h"
 #include "vlc_interaction.h"
 
-#undef PLAYLIST_DEBUG
-
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
@@ -192,9 +190,7 @@ void playlist_MainLoop( playlist_t *p_playlist )
     /* FIXME : this can be called several times */
     if( p_playlist->request.b_request )
     {
-#ifdef PLAYLIST_DEBUG
-        msg_Dbg(p_playlist, "incoming request - stopping current input" );
-#endif
+        PL_DEBUG( "incoming request - stopping current input" );
         /* Stop the existing input */
         if( p_playlist->p_input )
         {
@@ -235,6 +231,8 @@ void playlist_MainLoop( playlist_t *p_playlist )
                 & PLAYLIST_REMOVE_FLAG )
             {
                  playlist_ItemDelete( p_playlist->status.p_item );
+                 if( p_playlist->request.p_item == p_playlist->status.p_item )
+                     p_playlist->request.p_item = NULL;
                  p_playlist->status.p_item = NULL;
             }
 
@@ -440,9 +438,10 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj )
         vlc_mutex_lock( &p_obj->object_lock );
         i_activity=  var_GetInteger( p_playlist, "activity" );
         if( i_activity < 0 ) i_activity = 0;
+        vlc_mutex_unlock( &p_obj->object_lock );
         msleep( (i_activity+1) * 1000 );
+        return;
     }
-
     vlc_mutex_unlock( &p_obj->object_lock );
 }