Commit 792e9059 authored by Rafaël Carré's avatar Rafaël Carré

lpcm: fix BD decoding broken by 45c7b7c8764

We now output 20 and 24 bits PCM into S32N
Don't use swab, as it is forbidden for an odd number of channels

Fixes: #8982
parent 69d75edd
......@@ -1052,15 +1052,24 @@ static void BdExtract( block_t *p_aout_buffer, block_t *p_block,
{
uint8_t *p_src = p_block->p_buffer;
uint8_t *p_dst = p_aout_buffer->p_buffer;
int dst_inc = ((i_bits == 16) ? 2 : 4) * i_channels;
while( i_frame_length > 0 )
{
#ifdef WORDS_BIGENDIAN
memcpy( p_dst, p_src, i_channels * i_bits / 8 );
#else
swab( p_dst, p_src, i_channels * i_bits / 8 );
if (i_bits == 16) {
swab( p_dst, p_src, (i_channels + i_channels_padding) * i_bits / 8 );
} else {
p_dst[0] = 0;
p_dst[1] = p_src[2];
p_dst[2] = p_src[1];
p_dst[3] = p_src[0];
}
#endif
p_src += (i_channels + i_channels_padding) * i_bits / 8;
p_dst += (i_channels + 0) * i_bits / 8;
p_dst += dst_inc;
i_frame_length--;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment