output: removed audio_output.sameInAndOutFormats

Eliminate sameInAndOutFormats and check with audio_format_equals()
each time it this information is needed.  Another 4 bytes saved.
This commit is contained in:
Max Kellermann 2008-09-11 07:48:30 +02:00
parent 56cf54e880
commit 3aa4564b56
3 changed files with 2 additions and 8 deletions

View File

@ -66,7 +66,6 @@ struct audio_output {
ConvState convState;
char *convBuffer;
size_t convBufferLen;
int sameInAndOutFormats;
void *data;
};

View File

@ -44,10 +44,6 @@ int audio_output_open(struct audio_output *audioOutput,
if (!audioOutput->open)
ret = audioOutput->plugin->open(audioOutput);
audioOutput->sameInAndOutFormats =
audio_format_equals(&audioOutput->inAudioFormat,
&audioOutput->outAudioFormat);
return ret;
}
@ -82,9 +78,9 @@ int audio_output_play(struct audio_output *audioOutput,
if (!audioOutput->open)
return -1;
if (!audioOutput->sameInAndOutFormats) {
if (!audio_format_equals(&audioOutput->inAudioFormat,
&audioOutput->outAudioFormat))
convertAudioFormat(audioOutput, &playChunk, &size);
}
ret = audioOutput->plugin->play(audioOutput, playChunk, size);

View File

@ -86,7 +86,6 @@ int audio_output_init(struct audio_output *ao, ConfigParam * param)
ao->plugin = plugin;
ao->open = 0;
ao->sameInAndOutFormats = 0;
ao->convBuffer = NULL;
ao->convBufferLen = 0;