aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/output_api.h1
-rw-r--r--src/output_control.c2
-rw-r--r--src/output_init.c7
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;