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

Frederic YHUEL fyhuel at viotech.net
Tue Apr 24 15:35:48 CEST 2012


On Tue, Apr 24, 2012 at 1:57 PM, Tobias Güntner <fatbull at web.de> wrote:
> Hello!
>

Hello Tobias! Thanks for this review.

> 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?
>

Then it returns false... am I missing something?

>>> +        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?
>

What should I do?

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

Ah yes :-s  sorry


>>  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?

What does mean 1000ms worth of data?

-- 
Frédéric



More information about the vlc-devel mailing list