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.
This commit is contained in:
Max Kellermann 2008-08-26 08:27:12 +02:00
parent 60a155624c
commit e4c6c01903

View File

@ -839,7 +839,6 @@ static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data,
static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
ReplayGainInfo ** replayGainInfo)
{
unsigned int samplesPerFrame;
unsigned int samplesLeft;
unsigned int i;
int ret;
@ -886,7 +885,7 @@ static int mp3Read(mp3DecodeData * data, struct decoder *decoder,
mad_synth_frame(&data->synth, &data->frame);
if (!data->foundFirstFrame) {
samplesPerFrame = (data->synth).pcm.length;
unsigned int samplesPerFrame = (data->synth).pcm.length;
data->dropFramesAtStart = data->dropSamplesAtStart / samplesPerFrame;
data->dropFramesAtEnd = data->dropSamplesAtEnd / samplesPerFrame;
data->dropSamplesAtStart = data->dropSamplesAtStart % samplesPerFrame;