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

Tobias Güntner fatbull at web.de
Tue Apr 24 13:57:51 CEST 2012


Hello!

Am 24.04.2012 10:49, schrieb Laurent Aimar:
> 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 )

What if peek contains no '\0' and the needle is not in there?

>> +        return true;
>> +    else
>> +    /* maybe it's utf-16 encoding, should we also test other encodings? */
>> +    {
>> +        conv_peek = FromCharset( "UTF-16", peek, 1024 );

Little or big endian?

>> +        if( conv_peek != NULL )
>> +            if( strstr( conv_peek, needle ) != NULL )
>> +                return true;

conv_peek is leaked.

>> +    }
>> +    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).

How long is this delay? Do 1024 bytes actually matter?

Correct me if I'm wrong, but doesn't VLC cache 1000ms worth of data
before starting playback, assuming the default network-caching setting?
So the delay would not increase at all unless the available bandwidth
was lower than 1kB/s.

Regards,
Tobias




More information about the vlc-devel mailing list