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

Tristan Matthews le.businessman at gmail.com
Tue Jul 29 19:14:11 CEST 2014


Hi,

On Tue, Jul 29, 2014 at 1:05 PM, Antti Ajanki <antti.ajanki at iki.fi> wrote:
> ---
>  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, "?" );

nit: pathlen should be a size_t

> +    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
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list