Commit af77f367 authored by Erwan Tulou's avatar Erwan Tulou
Browse files

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.
parent 87364919
......@@ -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 );
......
......@@ -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 );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment