[FFmpeg-devel] [PATCH]VDPAU patch for VC1 decoding, round 1

Aurelien Jacobs aurel
Thu Jan 8 01:19:26 CET 2009


Diego Biurrun wrote:

> On Thu, Jan 08, 2009 at 12:50:09AM +0100, Aurelien Jacobs wrote:
> > Diego Biurrun wrote:
> > 
> > > On Wed, Jan 07, 2009 at 10:50:39PM +0100, Carl Eugen Hoyos wrote:
> > > >
> > > > --- libavcodec/vc1.c	(revision 16481)
> > > > +++ libavcodec/vc1.c	(working copy)
> > > > @@ -4317,3 +4338,35 @@
> > > > +
> > > > +#if ENABLE_WMV3_VDPAU_DECODER
> > > 
> > > Using ENABLE_ here is still wrong...
> > 
> > I disagree. Using #if ENABLE_ is better than #ifdef CONFIG_.
> > It is more readable, shorter,
> 
> Because you save 3 characters?  Hardly...
> 
> > and more consistent especially
> > in cases such as:
> >   #if   ENABLE_A
> >   #elif ENABLE_B
> >   #endif
> > or
> >   #if ENABLE_A || ENABLE_B
> 
> You missed the #endif in the second part.
> 
> But these cases have different semantics, so they are not
> comparable at all.

Apparently you missed my point so here it is more clearly:

  #if   ENABLE_A
  #elif ENABLE_B
  #endif
vs.
  #ifdef CONFIG_A
  #elif  defined(CONFIG_B)
  #endif

or

  #if ENABLE_A || ENABLE_B
vs.
  #if defined(CONFIG_A) || defined(CONFIG_B)

> > Moreover, #if gives a chance to the compiler to complain if
> > there is a typo in the symbol name. With #ifdef, such a
> > typo could stay unnoticed for a long time.
> 
> How so?

IIRC some compilers warn you if you #if SOME_UNDEFINED_SYMBOL.
It obviously can't warn you with #ifdef.

Aurel




More information about the ffmpeg-devel mailing list