[vlc-devel] [PATCH] Add Smooth Streaming module

Laurent Aimar fenrir at elivagar.org
Tue Apr 24 10:49:36 CEST 2012


Hi,

On Tue, Apr 24, 2012 at 10:23:20AM +0200, Frédéric Yhuel wrote:
> diff --git a/modules/stream_filter/smooth/smooth.c b/modules/stream_filter/smooth/smooth.c
> new file mode 100644
> index 0000000..4d25edc
> --- /dev/null
> +++ b/modules/stream_filter/smooth/smooth.c
> @@ -0,0 +1,755 @@
> +static bool isSmoothStreaming( stream_t *s )
> +{
> +    const uint8_t *peek;
> +    const char *conv_peek;
> +    const char *needle = "<SmoothStreamingMedia";
> +
> +    int i_size = stream_Peek( s->p_source, &peek, 1024 );
> +    if(  i_size < 1024 )
> +        return false;
> +
> +    if( strstr( (const char*)peek, needle ) != NULL )
> +        return true;
> +    else
> +    /* maybe it's utf-16 encoding, should we also test other encodings? */
> +    {
> +        conv_peek = FromCharset( "UTF-16", peek, 1024 );
> +        if( conv_peek != NULL )
> +            if( strstr( conv_peek, needle ) != NULL )
> +                return true;
> +    }
> +    return false;
> +}
 Do you really need that much data to detect the type? On a slow link, it will
increase the delay before the stream is actually played back (especially if
it is not a  smooth stream).

-- 
fenrir




More information about the vlc-devel mailing list