[vlc-devel] [PATCH] input: add url parsing of `input-slave` option
Alaric Senat
dev.asenat at posteo.net
Fri Apr 2 14:30:07 UTC 2021
As shown in #25549, we need to extract the path from the url in order to
check the file extension without the eventual HTTP's options noise.
Fixes: #25549
---
src/input/input.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/input/input.c b/src/input/input.c
index 286dfe3fd7..25c5c51769 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -984,8 +984,18 @@ static void GetVarSlaves( input_thread_t *p_input,
if( uri == NULL )
continue;
+ vlc_url_t parsed_uri = { 0 };
+ if ( vlc_UrlParse( &parsed_uri, uri ) != VLC_SUCCESS )
+ {
+ msg_Err( p_input,
+ "Invalid url passed to the \"input-slave\" option" );
+ vlc_UrlClean( &parsed_uri );
+ free( uri );
+ break;
+ }
+
enum slave_type i_type;
- if ( !input_item_slave_GetType(uri, &i_type) )
+ if ( !input_item_slave_GetType( parsed_uri.psz_path, &i_type ) )
{
msg_Warn( p_input,
"Can't deduce slave type of `%s\" with file extension.",
@@ -995,6 +1005,7 @@ static void GetVarSlaves( input_thread_t *p_input,
input_item_slave_t *p_slave =
input_item_slave_New( uri, i_type, SLAVE_PRIORITY_USER );
+ vlc_UrlClean( &parsed_uri );
free( uri );
if( unlikely( p_slave == NULL ) )
--
2.29.2
More information about the vlc-devel
mailing list