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

Jean-Baptiste Kempf jb at videolan.org
Fri Mar 23 09:37:21 CET 2012


On Fri, Mar 23, 2012 at 09:20:47AM +0100, Frederic YHUEL wrote :
> 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?

Drop it. Use your old version code.

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

Probably not. Add it somewhere in the file;

Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list