[vlc-commits] Fix lpcm decoding on little endian

Rafaël Carré git at videolan.org
Mon May 6 16:41:39 CEST 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon May  6 16:41:19 2013 +0200| [a54c03c5a7a61dfeeb7441111defc1dec49888a6] | committer: Rafaël Carré

Fix lpcm decoding on little endian

Close #8529

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a54c03c5a7a61dfeeb7441111defc1dec49888a6
---

 modules/codec/lpcm.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c
index 18c1f5b..402cd73 100644
--- a/modules/codec/lpcm.c
+++ b/modules/codec/lpcm.c
@@ -1054,7 +1054,11 @@ static void BdExtract( block_t *p_aout_buffer, block_t *p_block,
         uint8_t *p_dst = p_aout_buffer->p_buffer;
         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 );
+#endif
             p_src += (i_channels + i_channels_padding) * i_bits / 8;
             p_dst += (i_channels +                  0) * i_bits / 8;
             i_frame_length--;
@@ -1062,7 +1066,11 @@ static void BdExtract( block_t *p_aout_buffer, block_t *p_block,
     }
     else
     {
+#ifdef WORDS_BIGENDIAN
         memcpy( p_aout_buffer->p_buffer, p_block->p_buffer, p_block->i_buffer );
+#else
+        swab( p_block->p_buffer, p_aout_buffer->p_buffer, p_block->i_buffer );
+#endif
     }
 }
 



More information about the vlc-commits mailing list