[vlc-devel] commit: playlist: add a input-current variable for being completely predictable ( Erwan Tulou )

git version control git at videolan.org
Fri Sep 18 21:14:05 CEST 2009


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Thu Sep 10 22:05:48 2009 +0200| [af77f36724c16ac64702074d5bd9941c46f233b2] | committer: Erwan Tulou 

playlist: add a input-current variable for being completely predictable

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=af77f36724c16ac64702074d5bd9941c46f233b2
---

 src/playlist/engine.c |    1 +
 src/playlist/thread.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 5b068b4..0d68bb4 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -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 );
diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index db371d6..267d00e 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -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 );




More information about the vlc-devel mailing list