[vlc-devel] [PATCH] libmp4: add TfrfBox and TfxdBox parsing

Frederic YHUEL fyhuel at viotech.net
Fri Mar 23 09:20:47 CET 2012


On Thu, Mar 22, 2012 at 6:23 PM, Jean-Baptiste Kempf <jb at videolan.org> wrote:
> On Thu, Mar 22, 2012 at 05:41:36PM +0100, Frédéric Yhuel wrote :
>> +static inline int CmpUUID( const UUID_t *u1, const UUID_t *u2 )
>> +{
>> +    return memcmp( u1, u2, 16 );
>> +}
>
> guidcmp, if it is compatible... ( UUID_t vs GUID ?)
>

If I understand well a GUID is MS implementation of UUID, and there
are several versions... boring...
It's probably possible to cast a UUID_t into a GUID, or to replace
completely UUID_t structs by GUID ones, but I'm not sure that the
first solution is clean, and the second solution is not worthwhile for
so little code duplication IMVHO. Am I right?

>> +static int MP4_ReadBox_uuid( stream_t *p_stream, MP4_Box_t *p_box )
>> +{
>> +    if( !CmpUUID( &p_box->i_uuid, &TfrfBoxUUID ) )
>> +        return MP4_ReadBox_tfrf( p_stream, p_box );
>> +    if( !CmpUUID( &p_box->i_uuid, &TfxdBoxUUID ) )
>> +        return MP4_ReadBox_tfxd( p_stream, p_box );
>> +
>> +    msg_Warn( p_stream, "Unknown uuid type box" );
>> +    return 1;
> Why 1 ?
>

Good question, it seems to me that it is the error code when one
stumbles accross a unknown box or parameter, see MP4_ReadBox_default()
for example. Is there some doc about that somewhere?

> Rest seems ok.
>

Ok, thanks for the review!


-- 
Frédéric



More information about the vlc-devel mailing list