[vlc-commits] commit: Use make_URI() when creating input slaves (Pierre Ynard )

git at videolan.org git at videolan.org
Wed Jan 12 01:41:53 CET 2011


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Wed Jan 12 01:41:38 2011 +0100| [d7bf4abfd50923bd17732a7aaee145381861c5dd] | committer: Pierre Ynard 

Use make_URI() when creating input slaves

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d7bf4abfd50923bd17732a7aaee145381861c5dd
---

 src/input/input.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index beae17b..62e650c 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1097,15 +1097,18 @@ static void LoadSlaves( input_thread_t *p_input )
         if( *psz == 0 )
             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 );
-        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 );
         else
             free( p_slave );
-
-        psz = psz_delim;
+        free( uri );
     }
     free( psz_org );
 }
@@ -2030,16 +2033,19 @@ static bool Control( input_thread_t *p_input,
         case INPUT_CONTROL_ADD_SLAVE:
             if( val.psz_string )
             {
+                char *uri = make_URI( val.psz_string, NULL );
+                if( uri == NULL )
+                    break;
+
                 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;
                     int64_t i_time;
 
                     /* Add the slave */
-                    msg_Dbg( p_input, "adding %s as slave on the fly",
-                             val.psz_string );
+                    msg_Dbg( p_input, "adding %s as slave on the fly", uri );
 
                     /* Set position */
                     if( demux_Control( p_input->p->input.p_demux,
@@ -2073,9 +2079,9 @@ static bool Control( input_thread_t *p_input,
                 else
                 {
                     free( slave );
-                    msg_Warn( p_input, "failed to add %s as slave",
-                              val.psz_string );
+                    msg_Warn( p_input, "failed to add %s as slave", uri );
                 }
+                free( uri );
             }
             break;
 



More information about the vlc-commits mailing list