[vlc-devel] [PATCH] hds: Base URL should not include a possible query

Antti Ajanki antti.ajanki at iki.fi
Tue Jul 29 19:05:12 CEST 2014


---
 modules/stream_filter/hds/hds.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/stream_filter/hds/hds.c b/modules/stream_filter/hds/hds.c
index ae75994..5d0cac5 100644
--- a/modules/stream_filter/hds/hds.c
+++ b/modules/stream_filter/hds/hds.c
@@ -1411,17 +1411,18 @@ static int Open( vlc_object_t *p_this )
     if( unlikely( p_sys == NULL ) )
         return VLC_ENOMEM;
 
-    char *uri = NULL;
-    if( unlikely( asprintf( &uri, "%s://%s", s->psz_access, s->psz_path ) < 0 ) )
+    char *uri_without_query = NULL;
+    int pathlen = strcspn( s->psz_path, "?" );
+    if( unlikely( asprintf( &uri_without_query, "%s://%.*s", s->psz_access, pathlen, s->psz_path ) < 0 ) )
     {
         free( p_sys );
         return VLC_ENOMEM;
     }
 
     /* remove the last part of the url */
-    char *pos = strrchr( uri, '/');
+    char *pos = strrchr( uri_without_query, '/');
     *pos = '\0';
-    p_sys->base_url = uri;
+    p_sys->base_url = uri_without_query;
 
     p_sys->flv_header_bytes_sent = 0;
 
-- 
1.7.10.4




More information about the vlc-devel mailing list