From: Francois Cartegnie Date: Mon, 9 Mar 2015 16:00:15 +0000 (+0100) Subject: codec: lpcm: reorder channels only after decoding (fix #14114) X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=ab727f94736c1e34ee75d920689621e72ae080c9;p=vlc codec: lpcm: reorder channels only after decoding (fix #14114) 24bit LPCM is packed and can't be reordered without introducing clipping issues. --- diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c index c317e6f954..560d0d7d00 100644 --- a/modules/codec/lpcm.c +++ b/modules/codec/lpcm.c @@ -434,13 +434,6 @@ static block_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block ) p_block->p_buffer += p_sys->i_header_size + i_padding; p_block->i_buffer -= p_sys->i_header_size + i_padding; - if( p_sys->i_chans_to_reorder ) - { - aout_ChannelReorder( p_block->p_buffer, p_block->i_buffer, - p_sys->i_chans_to_reorder, p_sys->pi_chan_table, - p_dec->fmt_out.i_codec ); - } - switch( p_sys->i_type ) { case LPCM_WIDI: @@ -457,6 +450,13 @@ static block_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block ) break; } + if( p_sys->i_chans_to_reorder ) + { + aout_ChannelReorder( p_aout_buffer->p_buffer, p_aout_buffer->i_buffer, + p_sys->i_chans_to_reorder, p_sys->pi_chan_table, + p_dec->fmt_out.i_codec ); + } + block_Release( p_block ); return p_aout_buffer; }