diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:13 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-08-30 19:47:15 -0700 |
commit | f4f318fcffe454b4c74bb66a674b016f9ac501f3 (patch) | |
tree | c119d7e27897b73c65f0e9aa37360e15dbd9fff3 | |
parent | 6bb58f41a999fba23a758c072c8c1fd87cf209d3 (diff) | |
download | mpd-f4f318fcffe454b4c74bb66a674b016f9ac501f3.tar.gz mpd-f4f318fcffe454b4c74bb66a674b016f9ac501f3.tar.xz mpd-f4f318fcffe454b4c74bb66a674b016f9ac501f3.zip |
mp3: changed outputBuffer's type to mpd_sint16[]
The output buffer always contains mpd_sint16; declaring it with that
type saves several casts.
-rw-r--r-- | src/inputPlugins/mp3_plugin.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c index 40a2b9c73..46b0a875c 100644 --- a/src/inputPlugins/mp3_plugin.c +++ b/src/inputPlugins/mp3_plugin.c @@ -142,7 +142,7 @@ static int mp3_plugin_init(void) /* decoder stuff is based on madlld */ -#define MP3_DATA_OUTPUT_BUFFER_SIZE 4096 +#define MP3_DATA_OUTPUT_BUFFER_SIZE 2048 typedef struct _mp3DecodeData { struct mad_stream stream; @@ -150,7 +150,7 @@ typedef struct _mp3DecodeData { struct mad_synth synth; mad_timer_t timer; unsigned char readBuffer[READ_BUFFER_SIZE]; - char outputBuffer[MP3_DATA_OUTPUT_BUFFER_SIZE]; + mpd_sint16 outputBuffer[MP3_DATA_OUTPUT_BUFFER_SIZE]; float totalTime; float elapsedTime; int muteFrame; @@ -956,8 +956,7 @@ static int mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo) num_samples = max_samples; i += num_samples; - num_samples = dither_buffer((mpd_sint16 *) - data->outputBuffer, + num_samples = dither_buffer(data->outputBuffer, &data->synth, &data->dither, i - num_samples, i, MAD_NCHANNELS( |