[vlc-devel] [PATCH] Add Smooth Streaming module
Frederic YHUEL
fyhuel at viotech.net
Tue Apr 24 11:00:28 CEST 2012
On Tue, Apr 24, 2012 at 10:49 AM, Laurent Aimar <fenrir at elivagar.org> wrote:
> 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).
>
Ah ok I didn't think about it. Here is a typical Manifest header:
<?xml version="1.0" encoding="utf-16"?>
<!--Created with Expression Encoder version 2.1.1216.0-->
<SmoothStreamingMedia
MajorVersion="1"
MinorVersion="0"
I think 512 is fine to stay on the safe side. Is it still too much?
Thanks,
--
Frédéric
More information about the vlc-devel
mailing list