[MPlayer-dev-eng] [PATCH] #define __BSD_VISIBLE to 1

Alexander Strasser eclipse7 at gmx.net
Sat Feb 22 22:48:02 CET 2014


On 2014-02-22 21:08 +0100, Reimar Döffinger wrote:
> On Sat, Feb 22, 2014 at 09:05:42PM +0100, Alexander Strasser wrote:
> > On 2014-02-18 08:10 +0100, Alexander Strasser wrote:
> > > >  LIBAD_EXTERN(liba52)
> > > >  
> > > > +static void swap_bytes(uint8_t * buf, int size)
> > > > +{
> > > > +   size -= size & 1;
> > > > +   while (size > 0) {
> > > 
> > > > +     int16_t swapped = av_bswap16(AV_RN16(buf));
> > > > +     AV_WN16(buf, swapped);
> > > 
> > >   Or would it be better to do:
> > > 
> > >      AV_WB16(buf, AV_RL16(buf));
> > > 
> > >   ?
> > 
> >   Reimar (or anyone else), do you have some advice?
> 
> Oh, sorry.
> Yes, I think RL/WB or the other way round is nicer,
> but I don't like macros expanding inside macros,
> some compilers will create very messy code.

  Which could be overcome by using two lines instead,
but as I read on...

> On the other hand, maybe this is just overthinking it?
> Just do:
> FFSWAP(uint8_t, buf[0], buf[1]);
> Simpler, probably not really going to be slower,
> and it's only dnet anyway, performance should not
> matter that much.

  I finally committed this approach as it is simpler
and easier to read and probably just as well as the
alternatives.

Thanks for your help,
  Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20140222/3be3220f/attachment.asc>


More information about the MPlayer-dev-eng mailing list