aboutsummaryrefslogtreecommitdiffstats
path: root/src/mp3_decode.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-03-20 16:18:47 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-03-20 16:18:47 +0000
commit00e6078323d0ad0f1a8cd8c175322d083417d898 (patch)
tree39f9fe29a2dfd8e4296ea1008b0e014a814109c1 /src/mp3_decode.c
parent3130ea01c57a90629cfcf31edefafff7379c4367 (diff)
downloadmpd-00e6078323d0ad0f1a8cd8c175322d083417d898.tar.gz
mpd-00e6078323d0ad0f1a8cd8c175322d083417d898.tar.xz
mpd-00e6078323d0ad0f1a8cd8c175322d083417d898.zip
illiminated all endianness code
git-svn-id: https://svn.musicpd.org/mpd/trunk@327 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/mp3_decode.c23
1 files changed, 12 insertions, 11 deletions
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) {