[FFmpeg-cvslog] r10800 - trunk/libavformat/electronicarts.c

Aurelien Jacobs aurel
Fri Oct 19 21:20:54 CEST 2007


On Fri, 19 Oct 2007 16:40:03 +1000
"mark cox" <melbournemark+ffmpeg at gmail.com> wrote:

> On 19/10/2007, aurel <subversion at mplayerhq.hu> wrote:
> >
> > Author: aurel
> > Date: Fri Oct 19 01:21:31 2007
> > New Revision: 10800
> >
> > Log:
> > simplify
> >
> > Modified:
> >    trunk/libavformat/electronicarts.c
> >
> > Modified: trunk/libavformat/electronicarts.c
> >
> > ==============================================================================
> > --- trunk/libavformat/electronicarts.c  (original)
> > +++ trunk/libavformat/electronicarts.c  Fri Oct 19 01:21:31 2007
> > @@ -36,7 +36,6 @@
> > #define MV0F_TAG MKTAG('M', 'V', '0', 'F')
> >
> > #define EA_BITS_PER_SAMPLE 16
> > -#define EA_PREAMBLE_SIZE 8
> 
> This change creates a new undocumented constant '8'. Why not keep the
> define?

Because PREAMBLE_SIZE was not meaningful for me. I had to read the
code itself to understand that it was in fact the lenght of a
chunk id element + a chunk size element.

> > -        chunk_type = AV_RL32(&preamble[0]);
> > -        chunk_size = AV_RL32(&preamble[4]) - EA_PREAMBLE_SIZE;
> > +        chunk_type = get_le32(pb);
> > +        chunk_size = get_le32(pb) - 8;

Here it's obvious that 8 refers to the size of both get_le32.
It's IMO much more readable that way.

Aurel




More information about the ffmpeg-cvslog mailing list