[vlc-devel] [PATCH 1/3] hls: Support encryption

Jean-Baptiste Kempf jb at videolan.org
Mon Jan 23 16:15:24 CET 2012


On Fri, Jan 20, 2012 at 04:04:15PM +0100, Hugo Beauzée-Luyssen wrote :
> --- a/modules/stream_filter/Modules.am
> +++ b/modules/stream_filter/Modules.am
> @@ -2,12 +2,19 @@ SUBDIRS = dash
>  
>  SOURCES_decomp = decomp.c
>  SOURCES_stream_filter_record = record.c
> -SOURCES_stream_filter_httplive = httplive.c
>  
>  libvlc_LTLIBRARIES += \
>     libstream_filter_record_plugin.la \
> -   libstream_filter_httplive_plugin.la \
>     $(NULL)
> +
> +if HAVE_GCRYPT
> +libstream_filter_httplive_plugin_la_SOURCES = httplive.c
> +libstream_filter_httplive_plugin_la_CFLAGS = $(AM_CFLAGS) $(GCRYPT_CFLAGS)
> +libstream_filter_httplive_plugin_la_LIBADD = $(AM_LIBADD) $(GCRYPT_LIBS)
> +libstream_filter_httplive_plugin_la_DEPENDENCIES =
> +libvlc_LTLIBRARIES += libstream_filter_httplive_plugin.la
> +endif
> +
>  if !HAVE_WIN32
>  if !HAVE_WINCE
>  libvlc_LTLIBRARIES += libdecomp_plugin.la

OK.

> +    char        *psz_current_key_path;		/* URL path of the encrypted key */
No tabs, please.

> +        /* Url is put between quotes, remove them */
> +        if (*value == '"')
> +        {
> +            /* We need to strip the "" from the attribute value */
> +            unsigned int    i;
> +            uri = value + 1;
> +            for ( i=0; i < strlen(uri); i++ )
declare i in the for

> +            {
> +                if (uri[i] == '"')
> +                {
> +                    uri[i] = 0;
> +                    break;
> +                }
> +            }

Isn't this strchr on uri ?

> -    if (hls->version != 1)
> +    if (hls->version < 0 || hls->version > 3)
=< 0, I think

> +static int hls_DecodeSegmentData(stream_t *s, hls_stream_t *hls, segment_t *segment)

> +
> +
> +
> +
> +

That many ? :)

> -        if (p == NULL) return VLC_EGENERIC;
> +        if ( p == NULL )
> +            return VLC_EGENERIC;

Unrelated, I think... and weird.

> +            vlc_mutex_lock(&segment->lock);
> +
>              assert(p->url.psz_path);
>              assert(segment->url.psz_path);
>  
> -            vlc_mutex_lock(&segment->lock);
> -

Unrelated, but OK.

> +                    vlc_mutex_unlock(&segment->lock);
idem.

> -static int Download(stream_t *s, hls_stream_t *hls, segment_t *segment, int *cur_stream)
> +static int hls_DownloadSegmentData(stream_t *s, hls_stream_t *hls, segment_t *segment, int *cur_stream)

Unrelated to this patch


Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list