Cog Audio converter: Fix handling signed versus unsigned for 8 bit samples

This commit is contained in:
Christopher Snowhill 2022-01-11 19:37:47 -08:00
parent f44e4e793b
commit 91c3feac2e

View file

@ -547,7 +547,7 @@ tryagain:
size_t bitsPerSample = inputFormat.mBitsPerChannel;
if (bitsPerSample <= 8) {
samplesRead = bytesReadFromInput;
if (isUnsigned)
if (!isUnsigned)
convert_s8_to_s16(inputBuffer + bytesReadFromInput, inputBuffer, samplesRead);
else
convert_u8_to_s16(inputBuffer + bytesReadFromInput, inputBuffer, samplesRead);