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