<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
</head>
<body><div><br></div>
<div>On Wed, Oct 17, 2018, at 12:17, Rémi Denis-Courmont wrote:<br></div>
<blockquote type="cite"><div>Ok as of now, but don't we want to support different variables for different sources in the same input? <br></div>
</blockquote><div><br></div>
<div>Yes, maybe we need or will need that. In that case, could we set the variables on the demux object ? (each input source must have a valid demux object).<br></div>
<div><br></div>
<blockquote type="cite"><div><br></div>
<div defang_data-gmailquote="yes"><div>Le 17 octobre 2018 10:33:00 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><pre><div><hr> src/input/input.c | 31 +++++++++++++++----------------<br></div>
<div> src/input/input_internal.h | 2 --<br></div>
<div> 2 files changed, 15 insertions(+), 18 deletions(-)<br></div>
<div><br></div>
<div>diff --git a/src/input/input.c b/src/input/input.c<br></div>
<div>index a21111ff32..cd8e34db44 100644<br></div>
<div>--- a/src/input/input.c<br></div>
<div>+++ b/src/input/input.c<br></div>
<div>@@ -2456,20 +2456,20 @@ static void UpdateTitleListfromDemux( input_thread_t *p_input )<br></div>
<div> }<br></div>
<div> <br></div>
<div> static int<br></div>
<div>-InputStreamHandleAnchor( input_source_t *source, stream_t **stream,<br></div>
<div>- char const *anchor )<br></div>
<div>+InputStreamHandleAnchor( input_thread_t *p_input, input_source_t *source,<br></div>
<div>+ stream_t **stream, char const *anchor )<br></div>
<div> {<br></div>
<div> char const* extra;<br></div>
<div> if( stream_extractor_AttachParsed( stream, anchor, &extra ) )<br></div>
<div> {<br></div>
<div>- msg_Err( source, "unable to attach stream-extractors for %s",<br></div>
<div>+ msg_Err( p_input, "unable to attach stream-extractors for %s",<br></div>
<div> (*stream)->psz_url );<br></div>
<div> <br></div>
<div> return VLC_EGENERIC;<br></div>
<div> }<br></div>
<div> <br></div>
<div> if( vlc_stream_directory_Attach( stream, NULL ) )<br></div>
<div>- msg_Dbg( source, "attachment of directory-extractor failed for %s",<br></div>
<div>+ msg_Dbg( p_input, "attachment of directory-extractor failed for %s",<br></div>
<div> (*stream)->psz_url );<br></div>
<div> <br></div>
<div> MRLSections( extra ? extra : "",<br></div>
<div>@@ -2484,7 +2484,7 @@ static demux_t *InputDemuxNew( input_thread_t *p_input,<br></div>
<div> const char *psz_demux, const char *psz_anchor )<br></div>
<div> {<br></div>
<div> input_thread_private_t *priv = input_priv(p_input );<br></div>
<div>- vlc_object_t *obj = VLC_OBJECT(p_source);<br></div>
<div>+ vlc_object_t *obj = VLC_OBJECT(p_input);<br></div>
<div> <br></div>
<div> /* create the underlying access stream */<br></div>
<div> stream_t *p_stream = stream_AccessNew( obj, p_input, priv->p_es_out,<br></div>
<div>@@ -2504,7 +2504,7 @@ static demux_t *InputDemuxNew( input_thread_t *p_input,<br></div>
<div> }<br></div>
<div> <br></div>
<div> /* attach explicit stream filters to stream */<br></div>
<div>- char *psz_filters = var_InheritString( obj, "stream-filter" );<br></div>
<div>+ char *psz_filters = var_InheritString( p_input, "stream-filter" );<br></div>
<div> if( psz_filters )<br></div>
<div> {<br></div>
<div> p_stream = stream_FilterChainNew( p_stream, psz_filters );<br></div>
<div>@@ -2512,11 +2512,11 @@ static demux_t *InputDemuxNew( input_thread_t *p_input,<br></div>
<div> }<br></div>
<div> <br></div>
<div> /* handle anchors */<br></div>
<div>- if( InputStreamHandleAnchor( p_source, &p_stream, psz_anchor ) )<br></div>
<div>+ if( InputStreamHandleAnchor( p_input, p_source, &p_stream, psz_anchor ) )<br></div>
<div> goto error;<br></div>
<div> <br></div>
<div> /* attach conditional record stream-filter */<br></div>
<div>- if( var_InheritBool( obj, "input-record-native" ) )<br></div>
<div>+ if( var_InheritBool( p_input, "input-record-native" ) )<br></div>
<div> p_stream = stream_FilterChainNew( p_stream, "record" );<br></div>
<div> <br></div>
<div> /* create a regular demux with the access stream created */<br></div>
<div>@@ -2542,8 +2542,7 @@ static input_source_t *InputSourceNew( input_thread_t *p_input,<br></div>
<div> bool b_in_can_fail )<br></div>
<div> {<br></div>
<div> input_thread_private_t *priv = input_priv(p_input);<br></div>
<div>- input_source_t *in = vlc_custom_create( p_input, sizeof( *in ),<br></div>
<div>- "input source" );<br></div>
<div>+ input_source_t *in = calloc(1, sizeof(*in) );<br></div>
<div> if( unlikely(in == NULL) )<br></div>
<div> return NULL;<br></div>
<div> <br></div>
<div>@@ -2555,7 +2554,7 @@ static input_source_t *InputSourceNew( input_thread_t *p_input,<br></div>
<div> <br></div>
<div> if( psz_dup == NULL )<br></div>
<div> {<br></div>
<div>- vlc_object_release( in );<br></div>
<div>+ free( in );<br></div>
<div> return NULL;<br></div>
<div> }<br></div>
<div> <br></div>
<div>@@ -2563,7 +2562,7 @@ static input_source_t *InputSourceNew( input_thread_t *p_input,<br></div>
<div> input_SplitMRL( &psz_access, &psz_demux, &psz_path, &psz_anchor, psz_dup );<br></div>
<div> <br></div>
<div> if( psz_demux == NULL || psz_demux[0] == '\0' )<br></div>
<div>- psz_demux = psz_demux_var = var_InheritString( in, "demux" );<br></div>
<div>+ psz_demux = psz_demux_var = var_InheritString( p_input, "demux" );<br></div>
<div> <br></div>
<div> if( psz_forced_demux != NULL )<br></div>
<div> psz_demux = psz_forced_demux;<br></div>
<div>@@ -2644,7 +2643,7 @@ static input_source_t *InputSourceNew( input_thread_t *p_input,<br></div>
<div> vlc_dialog_display_error( p_input, _("Your input can't be opened"),<br></div>
<div> _("VLC is unable to open the MRL '%s'."<br></div>
<div> " Check the log for details."), psz_mrl );<br></div>
<div>- vlc_object_release( in );<br></div>
<div>+ free( in );<br></div>
<div> return NULL;<br></div>
<div> }<br></div>
<div> <br></div>
<div>@@ -2666,7 +2665,7 @@ static input_source_t *InputSourceNew( input_thread_t *p_input,<br></div>
<div> if( in->p_demux == NULL )<br></div>
<div> {<br></div>
<div> msg_Err(p_input, "Failed to create demux filter");<br></div>
<div>- vlc_object_release( in );<br></div>
<div>+ free( in );<br></div>
<div> return NULL;<br></div>
<div> }<br></div>
<div> }<br></div>
<div>@@ -2784,7 +2783,7 @@ static void InputSourceDestroy( input_source_t *in )<br></div>
<div> TAB_CLEAN( in->i_title, in->title );<br></div>
<div> }<br></div>
<div> <br></div>
<div>- vlc_object_release( in );<br></div>
<div>+ free( in );<br></div>
<div> }<br></div>
<div> <br></div>
<div> /*****************************************************************************<br></div>
<div>@@ -2814,7 +2813,7 @@ static void InputSourceMeta( input_thread_t *p_input,<br></div>
<div> return;<br></div>
<div> <br></div>
<div> demux_meta_t *p_demux_meta =<br></div>
<div>- vlc_custom_create( p_source, sizeof( *p_demux_meta ), "demux meta" );<br></div>
<div>+ vlc_custom_create( p_input, sizeof( *p_demux_meta ), "demux meta" );<br></div>
<div> if( unlikely(p_demux_meta == NULL) )<br></div>
<div> return;<br></div>
<div> p_demux_meta->p_item = input_priv(p_input)->p_item;<br></div>
<div>diff --git a/src/input/input_internal.h b/src/input/input_internal.h<br></div>
<div>index d1eaa2911e..bcc8f06a91 100644<br></div>
<div>--- a/src/input/input_internal.h<br></div>
<div>+++ b/src/input/input_internal.h<br></div>
<div>@@ -46,8 +46,6 @@ struct input_stats;<br></div>
<div> /* input_source_t: gathers all information per input source */<br></div>
<div> typedef struct<br></div>
<div> {<br></div>
<div>- struct vlc_common_members obj;<br></div>
<div>-<br></div>
<div> demux_t *p_demux; /**< Demux object (most downstream) */<br></div>
<div> <br></div>
<div> /* Title infos for that input */<br></div>
</pre></blockquote></div>
<div><br></div>
<div>-- <br></div>
<div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div>
<div><u>_______________________________________________</u><br></div>
<div>vlc-devel mailing list<br></div>
<div>To unsubscribe or modify your subscription options:<br></div>
<div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div>
</blockquote><div><br></div>
</body>
</html>