diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/output/Interface.hxx | 19 | ||||
-rw-r--r-- | src/output/plugins/ShoutOutputPlugin.cxx | 4 |
2 files changed, 8 insertions, 15 deletions
diff --git a/src/output/Interface.hxx b/src/output/Interface.hxx index ddc6ffa4b..f1059ad75 100644 --- a/src/output/Interface.hxx +++ b/src/output/Interface.hxx @@ -28,12 +28,16 @@ struct Tag; class AudioOutput { const unsigned flags; - bool need_fully_defined_audio_format = false; - protected: static constexpr unsigned FLAG_ENABLE_DISABLE = 0x1; static constexpr unsigned FLAG_PAUSE = 0x2; + /** + * This output requires an "audio_format" setting which + * evaluates AudioFormat::IsFullyDefined(). + */ + static constexpr unsigned FLAG_NEED_FULLY_DEFINED_AUDIO_FORMAT = 0x4; + public: explicit AudioOutput(unsigned _flags):flags(_flags) {} virtual ~AudioOutput() = default; @@ -50,16 +54,7 @@ public: } bool GetNeedFullyDefinedAudioFormat() const { - return need_fully_defined_audio_format; - } - - /** - * Plugins shall call this method if they require an - * "audio_format" setting which evaluates - * AudioFormat::IsFullyDefined(). - */ - void NeedFullyDefinedAudioFormat() { - need_fully_defined_audio_format = true; + return flags & FLAG_NEED_FULLY_DEFINED_AUDIO_FORMAT; } /** diff --git a/src/output/plugins/ShoutOutputPlugin.cxx b/src/output/plugins/ShoutOutputPlugin.cxx index 2a26ba8a4..97df09b21 100644 --- a/src/output/plugins/ShoutOutputPlugin.cxx +++ b/src/output/plugins/ShoutOutputPlugin.cxx @@ -97,12 +97,10 @@ ShoutSetAudioInfo(shout_t *shout_conn, const AudioFormat &audio_format) } ShoutOutput::ShoutOutput(const ConfigBlock &block) - :AudioOutput(FLAG_PAUSE), + :AudioOutput(FLAG_PAUSE|FLAG_NEED_FULLY_DEFINED_AUDIO_FORMAT), shout_conn(shout_new()), prepared_encoder(CreateConfiguredEncoder(block, true)) { - NeedFullyDefinedAudioFormat(); - const char *host = require_block_string(block, "host"); const char *mount = require_block_string(block, "mount"); unsigned port = block.GetBlockValue("port", 0u); |