]> git.sesse.net Git - vlc/blobdiff - src/input/input.c
Missing path->URI conversion for subtitles
[vlc] / src / input / input.c
index 94cd0eb4102466be595d00bee531242facfcdbf1..5c0181f5f5e0b1698776c2fbb4da83d13371be08 100644 (file)
@@ -3157,14 +3157,19 @@ static void SubtitleAdd( input_thread_t *p_input, char *psz_subtitle, bool b_for
         free( psz_path );
     }
 
+    char *url = make_URI( psz_subtitle );
+
     var_Change( p_input, "spu-es", VLC_VAR_CHOICESCOUNT, &count, NULL );
 
     sub = InputSourceNew( p_input );
-    if( !sub || InputSourceInit( p_input, sub, psz_subtitle, "subtitle" ) )
+    if( !sub || !url
+     || InputSourceInit( p_input, sub, url, "subtitle" ) )
     {
         free( sub );
+        free( url );
         return;
     }
+    free( url );
     TAB_APPEND( p_input->p->i_slave, p_input->p->slave, sub );
 
     /* Select the ES */