]> git.sesse.net Git - vlc/commitdiff
playlist: add a input-current variable for being completely predictable
authorErwan Tulou <erwan10@videolan.org>
Thu, 10 Sep 2009 20:05:48 +0000 (22:05 +0200)
committerErwan Tulou <erwan10@videolan.org>
Fri, 18 Sep 2009 19:11:21 +0000 (21:11 +0200)
this new variable will allow interfaces to get a chance to add callbacks on a new input _after_ variables are created and _before_ the input thread is started.

In previous design, callbacks were added haphazardly while the input thread was already being executed.

src/playlist/engine.c
src/playlist/thread.c

index 5b068b4083b086510056700f8ffaedeb5c426669..0d68bb4c371ae9d226c23a9fed61b3c749efe67c 100644 (file)
@@ -280,6 +280,7 @@ static void VariablesInit( playlist_t *p_playlist )
     var_Create( p_playlist, "playlist-item-append", VLC_VAR_ADDRESS );
 
     var_Create( p_playlist, "item-current", VLC_VAR_ADDRESS );
+    var_Create( p_playlist, "input-current", VLC_VAR_ADDRESS );
 
     var_Create( p_playlist, "activity", VLC_VAR_INTEGER );
     var_SetInteger( p_playlist, "activity", 0 );
index db371d6128415124898dd376ced067adc0c868b7..267d00e876b69dce01ce65e16fae86887621fc10 100644 (file)
@@ -259,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 );