From 00e6078323d0ad0f1a8cd8c175322d083417d898 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Sat, 20 Mar 2004 16:18:47 +0000 Subject: illiminated all endianness code git-svn-id: https://svn.musicpd.org/mpd/trunk@327 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/mp3_decode.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mp3_decode.c b/src/mp3_decode.c index ec495b002..a07485a32 100644 --- a/src/mp3_decode.c +++ b/src/mp3_decode.c @@ -404,9 +404,6 @@ int mp3ChildSendData(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) { if(dc->seek) return 0; /* be sure to remove this! */ -#ifdef WORDS_BIGENDIAN - pcm_changeBufferEndianness(data->outputBuffer,CHUNK_SIZE,16); -#endif memcpy(cb->chunks+cb->end*CHUNK_SIZE,data->outputBuffer,CHUNK_SIZE); cb->chunkSize[cb->end] = data->outputPtr-data->outputBuffer; cb->bitRate[cb->end] = data->bitRate/1024; @@ -461,16 +458,20 @@ int mp3Read(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) { mad_synth_frame(&data->synth,&data->frame); for(i=0;i<(data->synth).pcm.length;i++) { - signed int sample; - - sample = (signed int) audio_linear_dither(16,(data->synth).pcm.samples[0][i],&dither); - *(data->outputPtr++) = sample&0xff; - *(data->outputPtr++) = sample>>8; + mpd_sint16 * sample; + + sample = (mpd_sint16 *)data->outputPtr; + *sample = (mpd_sint16) audio_linear_dither(16, + (data->synth).pcm.samples[0][i], + &dither); + data->outputPtr+=2; if(MAD_NCHANNELS(&(data->frame).header)==2) { - sample = (signed int) audio_linear_dither(16,(data->synth).pcm.samples[1][i],&dither); - *(data->outputPtr++) = sample&0xff; - *(data->outputPtr++) = sample>>8; + sample = (mpd_sint16 *)data->outputPtr; + *sample = (mpd_sint16) audio_linear_dither(16, + (data->synth).pcm.samples[1][i], + &dither); + data->outputPtr+=2; } if(data->outputPtr==data->outputBufferEnd) { -- cgit v1.2.3