[alsa-devel] Suspecting a bug in plugin_ops.h

Soulard, MathieuX mathieux.soulard at intel.com
Fri May 27 09:41:40 CEST 2011


> > static inline u_int32_t sx24s(u_int32_t x)
> > {
> >         if(x&0x00008000)
> >                 return x|0x000000FF;
> >         return x&0xFFFFFF00;
> > }
> >
> > I think that 0x00008000 should be replaced by 0x00000800.
> 
> This function is indented to sign-extended a 24-bit value to 32 bits,
> operating in 'wrong' endianness.
> 
> Why do you think that the sign bit is in the highest bit of the second-
> highest nibble?

Well... because I think I made a mistake !
Actually I missed the endianness here, I thought about another format.

Thanks for your prompt response.


Thanks
Regards

Mathieu




More information about the Alsa-devel mailing list