]> git.sesse.net Git - vlc/blobdiff - src/input/demux.c
Implement access_GetParentInput and demux_GetParentInput and use.
[vlc] / src / input / demux.c
index 082f956bba7c48ea5e5300e5f9e1e68044e4be78..2a37ab1a4fc27a950e21bc4803f47a18dec1d6cf 100644 (file)
@@ -37,7 +37,7 @@ static bool SkipAPETag( demux_t *p_demux );
  * demux_New:
  *  if s is NULL then load a access_demux
  *****************************************************************************/
-demux_t *__demux_New( vlc_object_t *p_obj,
+demux_t *__demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input,
                        const char *psz_access, const char *psz_demux,
                        const char *psz_path,
                        stream_t *s, es_out_t *out, bool b_quick )
@@ -49,6 +49,8 @@ demux_t *__demux_New( vlc_object_t *p_obj,
 
     if( p_demux == NULL ) return NULL;
 
+    p_demux->p_input = p_parent_input;
+
     /* Parse URL */
     p_demux->psz_access = strdup( psz_access );
     p_demux->psz_demux  = strdup( psz_demux );
@@ -203,6 +205,15 @@ void demux_Delete( demux_t *p_demux )
     vlc_object_release( p_demux );
 }
 
+/*****************************************************************************
+ * demux_GetParentInput:
+ *****************************************************************************/
+input_thread_t * demux_GetParentInput( demux_t *p_demux )
+{
+    return p_demux->p_input ? vlc_object_hold((vlc_object_t*)p_demux->p_input) : NULL;
+}
+
+
 /*****************************************************************************
  * demux_vaControlHelper:
  *****************************************************************************/