]> git.sesse.net Git - vlc/commitdiff
codec: lpcm: reorder channels only after decoding (fix #14114)
authorFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 9 Mar 2015 16:00:15 +0000 (17:00 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 9 Mar 2015 16:10:15 +0000 (17:10 +0100)
24bit LPCM is packed and can't be reordered without introducing
clipping issues.

modules/codec/lpcm.c

index c317e6f9547e7162fb69893189d113c7e5d5e977..560d0d7d00e57f1c67bfdf9795e6921596bd94ea 100644 (file)
@@ -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;
     }