summaryrefslogtreecommitdiff
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-12-03 14:12:08 +0100
committerMax Kellermann <max@musicpd.org>2016-12-03 14:12:08 +0100
commit9fb7cc796b34f9faf8fa50354102a875e73fa476 (patch)
tree6e0bf5af8aa32fecfcc6b383bda35484e55d0e81 /src/Main.cxx
parent3472208c054507e2fd6616268570121579b5fcdb (diff)
decoder/Control: add attribute configured_audio_format
Obsoletes the same variable from AudioConfig.cxx.
Diffstat (limited to 'src/Main.cxx')
-rw-r--r--src/Main.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 8e576787b..381a10fc5 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -45,7 +45,7 @@
#include "playlist/PlaylistRegistry.hxx"
#include "zeroconf/ZeroconfGlue.hxx"
#include "decoder/DecoderList.hxx"
-#include "AudioConfig.hxx"
+#include "AudioParser.hxx"
#include "pcm/PcmConvert.hxx"
#include "unix/SignalHandlers.hxx"
#include "system/FatalError.hxx"
@@ -327,10 +327,23 @@ initialize_decoder_and_player(void)
config_get_positive(ConfigOption::MAX_PLAYLIST_LENGTH,
DEFAULT_PLAYLIST_MAX_LENGTH);
+ AudioFormat configured_audio_format = AudioFormat::Undefined();
+ param = config_get_param(ConfigOption::AUDIO_OUTPUT_FORMAT);
+ if (param != nullptr) {
+ try {
+ configured_audio_format = ParseAudioFormat(param->value.c_str(),
+ true);
+ } catch (const std::runtime_error &) {
+ std::throw_with_nested(FormatRuntimeError("error parsing line %i",
+ param->line));
+ }
+ }
+
instance->partition = new Partition(*instance,
max_length,
buffered_chunks,
buffered_before_play,
+ configured_audio_format,
replay_gain_config);
try {
@@ -489,7 +502,6 @@ try {
glue_sticker_init();
command_init();
- initAudioConfig();
instance->partition->outputs.Configure(instance->event_loop,
replay_gain_config,
instance->partition->pc);