[vlc-devel] [PATCH] cli: fixup URLs passed via command-line

Romain Vimont rom1v at videolabs.io
Mon Oct 12 14:53:11 CEST 2020


This allow VLC to open invalid URLs (using a space instead of %20
for example).
---
 src/libvlc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index c1dcde276d..ad5f300eff 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -442,8 +442,10 @@ static void GetFilenames( libvlc_int_t *p_vlc, unsigned n,
             if( !mrl )
                 continue;
         }
+        else
+            mrl = vlc_uri_fixup(args[n]);
 
-        intf_InsertItem( p_vlc, (mrl != NULL) ? mrl : args[n], i_options,
+        intf_InsertItem( p_vlc, mrl, i_options,
                          ( i_options ? &args[n + 1] : NULL ),
                          VLC_INPUT_OPTION_TRUSTED );
         free( mrl );
-- 
2.28.0



More information about the vlc-devel mailing list