illiminated all endianness code

git-svn-id: https://svn.musicpd.org/mpd/trunk@327 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-03-20 16:18:47 +00:00
parent 3130ea01c5
commit 00e6078323
1 changed files with 12 additions and 11 deletions

View File

@ -404,9 +404,6 @@ int mp3ChildSendData(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) {
if(dc->seek) return 0; if(dc->seek) return 0;
/* be sure to remove this! */ /* 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); memcpy(cb->chunks+cb->end*CHUNK_SIZE,data->outputBuffer,CHUNK_SIZE);
cb->chunkSize[cb->end] = data->outputPtr-data->outputBuffer; cb->chunkSize[cb->end] = data->outputPtr-data->outputBuffer;
cb->bitRate[cb->end] = data->bitRate/1024; 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); mad_synth_frame(&data->synth,&data->frame);
for(i=0;i<(data->synth).pcm.length;i++) { for(i=0;i<(data->synth).pcm.length;i++) {
signed int sample; mpd_sint16 * sample;
sample = (signed int) audio_linear_dither(16,(data->synth).pcm.samples[0][i],&dither); sample = (mpd_sint16 *)data->outputPtr;
*(data->outputPtr++) = sample&0xff; *sample = (mpd_sint16) audio_linear_dither(16,
*(data->outputPtr++) = sample>>8; (data->synth).pcm.samples[0][i],
&dither);
data->outputPtr+=2;
if(MAD_NCHANNELS(&(data->frame).header)==2) { if(MAD_NCHANNELS(&(data->frame).header)==2) {
sample = (signed int) audio_linear_dither(16,(data->synth).pcm.samples[1][i],&dither); sample = (mpd_sint16 *)data->outputPtr;
*(data->outputPtr++) = sample&0xff; *sample = (mpd_sint16) audio_linear_dither(16,
*(data->outputPtr++) = sample>>8; (data->synth).pcm.samples[1][i],
&dither);
data->outputPtr+=2;
} }
if(data->outputPtr==data->outputBufferEnd) { if(data->outputPtr==data->outputBufferEnd) {