output: removed audio_output.convertAudioFormat

Instead of checking convertAudioFormat, we can simply check if
reqAudioFormat is defined.  This saves 4 bytes in the struct.
This commit is contained in:
Max Kellermann 2008-09-11 07:47:28 +02:00
parent a751011e8c
commit 56cf54e880
3 changed files with 3 additions and 7 deletions

View File

@ -60,7 +60,6 @@ struct audio_output {
const struct audio_output_plugin *plugin;
int convertAudioFormat;
struct audio_format inAudioFormat;
struct audio_format outAudioFormat;
struct audio_format reqAudioFormat;

View File

@ -33,7 +33,7 @@ int audio_output_open(struct audio_output *audioOutput,
audioOutput->inAudioFormat = *audioFormat;
if (audioOutput->convertAudioFormat) {
if (audio_format_defined(&audioOutput->reqAudioFormat)) {
audioOutput->outAudioFormat = audioOutput->reqAudioFormat;
} else {
audioOutput->outAudioFormat = audioOutput->inAudioFormat;

View File

@ -86,25 +86,22 @@ int audio_output_init(struct audio_output *ao, ConfigParam * param)
ao->plugin = plugin;
ao->open = 0;
ao->convertAudioFormat = 0;
ao->sameInAndOutFormats = 0;
ao->convBuffer = NULL;
ao->convBufferLen = 0;
memset(&ao->inAudioFormat, 0, sizeof(ao->inAudioFormat));
memset(&ao->outAudioFormat, 0, sizeof(ao->outAudioFormat));
memset(&ao->reqAudioFormat, 0, sizeof(ao->reqAudioFormat));
memset(&ao->convState, 0, sizeof(ConvState));
if (format) {
ao->convertAudioFormat = 1;
if (0 != parseAudioConfig(&ao->reqAudioFormat, format)) {
FATAL("error parsing format at line %i\n", bp->line);
}
ao->outAudioFormat = ao->reqAudioFormat;
}
} else
audio_format_clear(&ao->reqAudioFormat);
if (plugin->init(ao, param) != 0)
return 0;