Commit d7bf4abf authored by Pierre Ynard's avatar Pierre Ynard

Use make_URI() when creating input slaves

parent daed9da9
...@@ -1097,15 +1097,18 @@ static void LoadSlaves( input_thread_t *p_input ) ...@@ -1097,15 +1097,18 @@ static void LoadSlaves( input_thread_t *p_input )
if( *psz == 0 ) if( *psz == 0 )
break; break;
msg_Dbg( p_input, "adding slave input '%s'", psz ); char *uri = make_URI( psz, NULL );
psz = psz_delim;
if( uri == NULL )
continue;
msg_Dbg( p_input, "adding slave input '%s'", uri );
input_source_t *p_slave = InputSourceNew( p_input ); input_source_t *p_slave = InputSourceNew( p_input );
if( p_slave && !InputSourceInit( p_input, p_slave, psz, NULL ) ) if( p_slave && !InputSourceInit( p_input, p_slave, uri, NULL ) )
TAB_APPEND( p_input->p->i_slave, p_input->p->slave, p_slave ); TAB_APPEND( p_input->p->i_slave, p_input->p->slave, p_slave );
else else
free( p_slave ); free( p_slave );
free( uri );
psz = psz_delim;
} }
free( psz_org ); free( psz_org );
} }
...@@ -2030,16 +2033,19 @@ static bool Control( input_thread_t *p_input, ...@@ -2030,16 +2033,19 @@ static bool Control( input_thread_t *p_input,
case INPUT_CONTROL_ADD_SLAVE: case INPUT_CONTROL_ADD_SLAVE:
if( val.psz_string ) if( val.psz_string )
{ {
char *uri = make_URI( val.psz_string, NULL );
if( uri == NULL )
break;
input_source_t *slave = InputSourceNew( p_input ); input_source_t *slave = InputSourceNew( p_input );
if( slave && !InputSourceInit( p_input, slave, val.psz_string, NULL ) ) if( slave && !InputSourceInit( p_input, slave, uri, NULL ) )
{ {
vlc_meta_t *p_meta; vlc_meta_t *p_meta;
int64_t i_time; int64_t i_time;
/* Add the slave */ /* Add the slave */
msg_Dbg( p_input, "adding %s as slave on the fly", msg_Dbg( p_input, "adding %s as slave on the fly", uri );
val.psz_string );
/* Set position */ /* Set position */
if( demux_Control( p_input->p->input.p_demux, if( demux_Control( p_input->p->input.p_demux,
...@@ -2073,9 +2079,9 @@ static bool Control( input_thread_t *p_input, ...@@ -2073,9 +2079,9 @@ static bool Control( input_thread_t *p_input,
else else
{ {
free( slave ); free( slave );
msg_Warn( p_input, "failed to add %s as slave", msg_Warn( p_input, "failed to add %s as slave", uri );
val.psz_string );
} }
free( uri );
} }
break; break;
......
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