diff options
author | Max Kellermann <max@duempel.org> | 2008-09-11 07:47:28 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-11 07:47:28 +0200 |
commit | 56cf54e880359d40dae7df460b23101a4f1a77fb (patch) | |
tree | a8355909361852235c3cb04fc403f25b6551c604 /src | |
parent | a751011e8cf5bf8cfbcd3f3be9eb424d6569b7e7 (diff) | |
download | mpd-56cf54e880359d40dae7df460b23101a4f1a77fb.tar.gz mpd-56cf54e880359d40dae7df460b23101a4f1a77fb.tar.xz mpd-56cf54e880359d40dae7df460b23101a4f1a77fb.zip |
output: removed audio_output.convertAudioFormat
Instead of checking convertAudioFormat, we can simply check if
reqAudioFormat is defined. This saves 4 bytes in the struct.
Diffstat (limited to '')
-rw-r--r-- | src/output_api.h | 1 | ||||
-rw-r--r-- | src/output_control.c | 2 | ||||
-rw-r--r-- | src/output_init.c | 7 |
3 files changed, 3 insertions, 7 deletions
diff --git a/src/output_api.h b/src/output_api.h index df1fb7e4c..d59fa8424 100644 --- a/src/output_api.h +++ b/src/output_api.h @@ -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; diff --git a/src/output_control.c b/src/output_control.c index df330ee21..7e181aca2 100644 --- a/src/output_control.c +++ b/src/output_control.c @@ -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; diff --git a/src/output_init.c b/src/output_init.c index d339f3540..0a91565c8 100644 --- a/src/output_init.c +++ b/src/output_init.c @@ -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; |