Commit bf5774ed authored by Max Kellermann's avatar Max Kellermann

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.
parent 0078837a
...@@ -922,7 +922,8 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo) ...@@ -922,7 +922,8 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
} }
max_samples = sizeof(data->outputBuffer) / max_samples = sizeof(data->outputBuffer) /
(2 * MAD_NCHANNELS(&(data->frame).header)); sizeof(data->outputBuffer[0]) /
MAD_NCHANNELS(&(data->frame).header);
while (i < pcm_length) { while (i < pcm_length) {
enum decoder_command cmd; enum decoder_command cmd;
...@@ -940,7 +941,7 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo) ...@@ -940,7 +941,7 @@ mp3Read(mp3DecodeData * data, ReplayGainInfo ** replayGainInfo)
cmd = decoder_data(decoder, data->inStream, cmd = decoder_data(decoder, data->inStream,
data->inStream->seekable, data->inStream->seekable,
data->outputBuffer, data->outputBuffer,
2 * num_samples, sizeof(data->outputBuffer[0]) * num_samples,
data->elapsedTime, data->elapsedTime,
data->bitRate / 1000, data->bitRate / 1000,
(replayGainInfo != NULL) ? *replayGainInfo : NULL); (replayGainInfo != NULL) ? *replayGainInfo : NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment