aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-23 16:58:14 +0200
committerMax Kellermann <max@duempel.org>2008-10-23 16:58:14 +0200
commitbf5774edbd29ecf4d14119e04acf65d16dd762fa (patch)
tree2b8b0c7a1618162595e77fc086634c758941d20a
parent0078837a9760b8b5a14c87af0cb44a107462db7b (diff)
downloadmpd-bf5774edbd29ecf4d14119e04acf65d16dd762fa.tar.gz
mpd-bf5774edbd29ecf4d14119e04acf65d16dd762fa.tar.xz
mpd-bf5774edbd29ecf4d14119e04acf65d16dd762fa.zip
mp3: use sizeof(sample) instead of hard-coded "2"
We are going to convert the code to 24 bit; don't hard-code a sample size of 2 bytes.
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/mp3_plugin.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c
index 18eddf017..158a152cd 100644
--- a/src/inputPlugins/mp3_plugin.c
+++ b/src/inputPlugins/mp3_plugin.c
@@ -922,7 +922,8 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
}
max_samples = sizeof(data->outputBuffer) /
- (2 * MAD_NCHANNELS(&(data->frame).header));
+ sizeof(data->outputBuffer[0]) /
+ MAD_NCHANNELS(&(data->frame).header);
while (i < pcm_length) {
enum decoder_command cmd;
@@ -940,7 +941,7 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
cmd = decoder_data(decoder, data->inStream,
data->inStream->seekable,
data->outputBuffer,
- 2 * num_samples,
+ sizeof(data->outputBuffer[0]) * num_samples,
data->elapsedTime,
data->bitRate / 1000,
(replayGainInfo != NULL) ? *replayGainInfo : NULL);