alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
366 stars 177 forks source link

pcm: dmix: fix wrong scaling in 32bits pcm mixing #222

Closed katsuster closed 2 years ago

katsuster commented 2 years ago

Generic mixing function for 32bits pcm has used 8bits right shift for pre-scaling. But this is generating wrong result if pcm data is negative value because return value type of bswap_32() is unsigned int.

This patch adds type cast bswap_32() result to signed int.

perexg commented 2 years ago

Thanks. Applied.