[MPlayer-dev-eng] [PATCH] #define __BSD_VISIBLE to 1
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sat Feb 22 21:08:53 CET 2014
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.
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.
More information about the MPlayer-dev-eng
mailing list