Commit 70a513b9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

stream_filter: separate hard-coded "record" stream filter insertion

parent 15a2182a
......@@ -2313,10 +2313,12 @@ static int InputSourceInit( input_thread_t *p_input,
char *psz_stream_filter = var_GetNonEmptyString( p_input,
"stream-filter" );
p_stream = stream_FilterChainNew( p_stream, psz_stream_filter,
var_GetBool( p_input, "input-record-native" ) );
p_stream = stream_FilterChainNew( p_stream, psz_stream_filter );
free( psz_stream_filter );
if( var_GetBool( p_input, "input-record-native" ) )
p_stream = stream_FilterChainNew( p_stream, "record" );
if( !p_input->b_preparsing )
{
bool b;
......
......@@ -55,14 +55,11 @@ stream_t *stream_FilterNew( stream_t *p_source,
stream_t *stream_FilterAutoNew( stream_t *source ) VLC_USED;
/**
* This function creates a chain of filters:
* - optional user filters (configured by psz_chain) are inserted.
* - an optional record filter is inserted if b_record is true.
* This function creates a chain of filters according to the colon-separated
* list.
*
* You must release the returned value using stream_Delete unless it is used as a
* source to another filter.
*/
stream_t *stream_FilterChainNew( stream_t *p_source,
const char *psz_chain,
bool b_record );
stream_t *stream_FilterChainNew( stream_t *p_source, const char *psz_chain );
#endif
......@@ -88,12 +88,13 @@ stream_t *stream_FilterAutoNew( stream_t *p_source )
return p_source;
}
stream_t *stream_FilterChainNew( stream_t *p_source,
const char *psz_chain,
bool b_record )
stream_t *stream_FilterChainNew( stream_t *p_source, const char *psz_chain )
{
if( psz_chain == NULL )
return p_source;
/* Add user stream filter */
char *psz_tmp = psz_chain ? strdup( psz_chain ) : NULL;
char *psz_tmp = strdup( psz_chain );
char *psz = psz_tmp;
while( psz && *psz )
{
......@@ -113,13 +114,6 @@ stream_t *stream_FilterChainNew( stream_t *p_source,
}
free( psz_tmp );
/* Add record filter if useful */
if( b_record )
{
stream_t *p_filter = stream_FilterNew( p_source, "record" );
if( p_filter )
p_source = p_filter;
}
return p_source;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment