Commit e4c6c019 authored by Max Kellermann's avatar Max Kellermann

mp3: make samplesPerFrame more local

The variable samplesPerFrame is used only in one single closure. Make it local to this closure. The compiler will probably convert it to a register anyway.
parent 60a15562
...@@ -839,7 +839,6 @@ static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data, ...@@ -839,7 +839,6 @@ static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data,
static int mp3Read(mp3DecodeData * data, struct decoder *decoder, static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
ReplayGainInfo ** replayGainInfo) ReplayGainInfo ** replayGainInfo)
{ {
unsigned int samplesPerFrame;
unsigned int samplesLeft; unsigned int samplesLeft;
unsigned int i; unsigned int i;
int ret; int ret;
...@@ -886,7 +885,7 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder, ...@@ -886,7 +885,7 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
mad_synth_frame(&data->synth, &data->frame); mad_synth_frame(&data->synth, &data->frame);
if (!data->foundFirstFrame) { if (!data->foundFirstFrame) {
samplesPerFrame = (data->synth).pcm.length; unsigned int samplesPerFrame = (data->synth).pcm.length;
data->dropFramesAtStart = data->dropSamplesAtStart / samplesPerFrame; data->dropFramesAtStart = data->dropSamplesAtStart / samplesPerFrame;
data->dropFramesAtEnd = data->dropSamplesAtEnd / samplesPerFrame; data->dropFramesAtEnd = data->dropSamplesAtEnd / samplesPerFrame;
data->dropSamplesAtStart = data->dropSamplesAtStart % samplesPerFrame; data->dropSamplesAtStart = data->dropSamplesAtStart % samplesPerFrame;
......
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