[MPlayer-dev-eng] [PATCH 3/9] ad_libmad: Use BE sample format on big endian architectures

Hans-Christian Egtvedt hans-christian.egtvedt at atmel.com
Mon Feb 16 17:16:52 CET 2009


Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt at atmel.com>
---
 libmpcodecs/ad_libmad.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libmpcodecs/ad_libmad.c b/libmpcodecs/ad_libmad.c
index 076359a..51b77fe 100644
--- a/libmpcodecs/ad_libmad.c
+++ b/libmpcodecs/ad_libmad.c
@@ -86,6 +86,11 @@ static int init(sh_audio_t *sh){
   sh->channels=(this->frame.header.mode == MAD_MODE_SINGLE_CHANNEL) ? 1 : 2;
   sh->samplerate=this->frame.header.samplerate;
   sh->i_bps=this->frame.header.bitrate/8;
+#ifdef WORDS_BIGENDIAN
+  sh->sample_format = AF_FORMAT_S16_BE;
+#else
+  sh->sample_format = AF_FORMAT_S16_LE;
+#endif
   sh->samplesize=2;
   
   return 1;
-- 
1.5.6.3




More information about the MPlayer-dev-eng mailing list