[Ffmpeg-devel] [PATCH] video4linux2 input

Rich Felker dalias
Mon Feb 6 18:06:52 CET 2006


On Mon, Feb 06, 2006 at 12:22:39PM +0100, Erik Slagter wrote:
> On Sun, 2006-02-05 at 17:00 +0100, Aurelien Jacobs wrote:
> > I disagree.
> > It should probably read something like this:
> > 
> > typedef enum {
> >   QCIF = 0,
> >   CIF = 1,
> > } res_desc_t;
> > 
> > if (width == 176 && height == 144)
> >   return QCIF;
> > else if (width == 352 && height == 288)
> >   return CIF;
> > else
> >   return -1;
> 
> To be even more elegant, I'd use a enum AND a table. #define's for
> constants are evil, indeed.

Do you have any good reason to say this or is it just more CS dogma?

Rich





More information about the ffmpeg-devel mailing list