[FFmpeg-devel] sdp.c and CONFIG_RTP_MUXER

Michael Niedermayer michaelni
Tue Jul 31 11:49:42 CEST 2007


Hi

On Tue, Jul 31, 2007 at 11:12:40AM +0200, Luca Abeni wrote:
> Hi Thijs,
> 
> On Tue, 2007-07-31 at 10:54 +0200, Thijs Vermeir wrote:
> [...]
> >      return buff;
> > +    } else {
> > +    return NULL;
> > +    }
> >  }
> > 
> > The code in the avf_sdp_create is always compiled ...
> 
> Yes, but the compiler is smart enough (I think ;-) to understand that
> ENABLE_RTP_MUXER is a constant, and is always 0 if the RTP muxer is not
> configured in. So, the compiler can discard the reference to
> rtp_get_payload_type(), and the linking error disappears (at least, this
> is what seems to be happening here).
> 
> 
> >  isn't it better to use ?
> > #ifdef ENABLE_RTP_MUXER
> > {
> >  ...
> > }
> > #else
> >   return NULL;
> > #endif
> 
> This was my first try... It works, but it generates warnings because
> some static functions are defined but not used in sdp.c. But I am ok
> with this version too, if it is preferred.

i prefer the #ifdef over if() as later is just not correct its pure luck
that it works
also here theres no difference in complexity, the if() is not simpler

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070731/a0c555c8/attachment.pgp>



More information about the ffmpeg-devel mailing list