From 11ce842eb87bbbeccf3e9b09c823829d3f621984 Mon Sep 17 00:00:00 2001 From: Thomas Guillem Date: Fri, 20 Jul 2018 14:35:04 +0200 Subject: [PATCH] chromecast: replace the p_input hack by an other one This is very questionable if this hack is cleaner that the previous one. But this one doesn't depend on the input_thread_t that we want to hide from demuxers. Furthermore, it allows more controls with applications using libvlc that will receive a CorkEvent. --- modules/stream_out/chromecast/chromecast_demux.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/stream_out/chromecast/chromecast_demux.cpp b/modules/stream_out/chromecast/chromecast_demux.cpp index 915298c6e1..e076a18f4d 100644 --- a/modules/stream_out/chromecast/chromecast_demux.cpp +++ b/modules/stream_out/chromecast/chromecast_demux.cpp @@ -457,10 +457,21 @@ protected: static void on_paused_changed_cb( void *data, bool paused ) { demux_t *p_demux = reinterpret_cast(data); + vlc_object_t *obj = p_demux->p_next->obj.parent; - input_thread_t *p_input = p_demux->p_next->p_input; - if( p_input ) - var_SetInteger( p_input, "state", paused ? PAUSE_S : PLAYING_S ); + /* XXX: Ugly: Notify the parent of the input_thread_t that the corks state + * changed */ + while( obj != NULL ) + { + /* Try to find the playlist or the mediaplayer that handle the corks + * state */ + if( var_Type( obj, "corks" ) != 0 ) + { + ( paused ? var_IncInteger : var_DecInteger )( obj, "corks" ); + return; + } + obj = obj->obj.parent; + } } static int Demux( demux_t *p_demux_filter ) -- 2.11.4.GIT