]> git.sesse.net Git - vlc/blobdiff - src/playlist/thread.c
playlist: add a fixme => race condition.
[vlc] / src / playlist / thread.c
index 3e7bf06ed0e06cfdb0ab55d019f7c658cdbd85d6..a571f69f1ef0a85bb0022e7f980597125462d204 100644 (file)
@@ -25,6 +25,8 @@
 # include "config.h"
 #endif
 
+#include <assert.h>
+
 #include <vlc_common.h>
 #include <vlc_es.h>
 #include <vlc_input.h>
@@ -257,6 +259,8 @@ static int PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
         p_sys->p_input = p_input_thread;
         var_AddCallback( p_input_thread, "intf-event", InputEvent, p_playlist );
 
+        var_SetAddress( p_playlist, "input-current", p_input_thread );
+
         if( input_Start( p_sys->p_input ) )
         {
             vlc_object_release( p_input_thread );
@@ -295,7 +299,7 @@ static int PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
         free( psz_arturl );
         free( psz_name );
     }
-
+    /* FIXME: this is not safe !!*/
     PL_UNLOCK;
     var_SetAddress( p_playlist, "item-current", p_input );
     PL_LOCK;