[vlc-devel] [PATCH] [RFC] playlist: broadcast the input_thread_t about to be started for a chance to alter it
Steve Lhomme
robux4 at videolabs.io
Wed Dec 23 22:32:58 CET 2015
--
deprecates https://patches.videolan.org/patch/10518/
---
src/playlist/engine.c | 1 +
src/playlist/thread.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 6000a37..971667c 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -450,6 +450,7 @@ static void VariablesInit( playlist_t *p_playlist )
var_Create( p_playlist, "playlist-item-append", VLC_VAR_ADDRESS );
var_Create( p_playlist, "input-current", VLC_VAR_ADDRESS );
+ var_Create( p_playlist, "input-prepare", VLC_VAR_ADDRESS );
/* Variables to control playback */
var_Create( p_playlist, "playlist-autostart", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index a348479..4fd7580 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -207,6 +207,9 @@ static bool PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
input_thread_t *p_input_thread = input_Create( p_playlist, p_input, NULL,
p_sys->p_input_resource );
+
+ var_SetAddress( p_playlist, "input-prepare", p_input_thread );
+
if( likely(p_input_thread != NULL) )
{
var_AddCallback( p_input_thread, "intf-event",
@@ -451,6 +454,7 @@ static void LoopInput( playlist_t *p_playlist )
PL_DEBUG( "dead input" );
PL_UNLOCK;
+ var_SetAddress( p_playlist, "input-prepare", NULL );
var_SetAddress( p_playlist, "input-current", NULL );
/* WARNING: Input resource manipulation and callback deletion are
--
2.6.0.windows.1
More information about the vlc-devel
mailing list