[vlc-commits] chromecast: Implement DEMUX_FILTER_ENABLE/DISABLE
Hugo Beauzée-Luyssen
git at videolan.org
Tue Sep 19 11:49:28 CEST 2017
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jul 10 15:15:42 2017 +0200| [0b5b025c22d2125b8b49c3db9be59faaa2570dd9] | committer: Hugo Beauzée-Luyssen
chromecast: Implement DEMUX_FILTER_ENABLE/DISABLE
fix #18605
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0b5b025c22d2125b8b49c3db9be59faaa2570dd9
---
modules/stream_out/chromecast/chromecast_demux.cpp | 27 +++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/modules/stream_out/chromecast/chromecast_demux.cpp b/modules/stream_out/chromecast/chromecast_demux.cpp
index 88e8b69aeb..618c07d5ca 100644
--- a/modules/stream_out/chromecast/chromecast_demux.cpp
+++ b/modules/stream_out/chromecast/chromecast_demux.cpp
@@ -45,6 +45,7 @@ struct demux_sys_t
,demuxReady(false)
,canSeek(false)
,m_seektime( VLC_TS_INVALID )
+ ,m_enabled( true )
{
vlc_meta_t *p_meta = vlc_meta_New();
if( likely(p_meta != NULL) )
@@ -64,8 +65,11 @@ struct demux_sys_t
~demux_sys_t()
{
- p_renderer->pf_set_title( p_renderer->p_opaque, NULL );
- p_renderer->pf_set_artwork( p_renderer->p_opaque, NULL );
+ if( p_renderer )
+ {
+ p_renderer->pf_set_title( p_renderer->p_opaque, NULL );
+ p_renderer->pf_set_artwork( p_renderer->p_opaque, NULL );
+ }
}
void setPauseState(bool paused)
@@ -119,6 +123,9 @@ struct demux_sys_t
int Demux()
{
+ if ( !m_enabled )
+ return demux_Demux( p_demux->p_next );
+
if (!demuxReady)
{
msg_Dbg(p_demux, "wait to demux");
@@ -140,6 +147,9 @@ struct demux_sys_t
int Control( demux_t *p_demux_filter, int i_query, va_list args )
{
+ if( !m_enabled && i_query != DEMUX_FILTER_ENABLE )
+ return demux_vaControl( p_demux_filter->p_next, i_query, args );
+
switch (i_query)
{
case DEMUX_GET_POSITION:
@@ -230,6 +240,16 @@ struct demux_sys_t
setPauseState( paused != 0 );
break;
}
+ case DEMUX_FILTER_ENABLE:
+ p_renderer = static_cast<chromecast_common *>(
+ var_InheritAddress( p_demux, CC_SHARED_VAR_NAME ) );
+ m_enabled = true;
+ return VLC_SUCCESS;
+
+ case DEMUX_FILTER_DISABLE:
+ m_enabled = false;
+ p_renderer = NULL;
+ return VLC_SUCCESS;
}
return demux_vaControl( p_demux_filter->p_next, i_query, args );
@@ -237,12 +257,13 @@ struct demux_sys_t
protected:
demux_t * const p_demux;
- chromecast_common * const p_renderer;
+ chromecast_common * p_renderer;
mtime_t i_length;
bool demuxReady;
bool canSeek;
/* seek time kept while waiting for the chromecast to "seek" */
mtime_t m_seektime;
+ bool m_enabled;
};
static int Demux( demux_t *p_demux_filter )
More information about the vlc-commits
mailing list