Commit e1122949 authored by Max Kellermann's avatar Max Kellermann

output/Filtered: add method NeedFullyDefinedAudioFormat()

Avoid accessing FilteredAudioFormat attributes directly.
parent ccc0fcb5
......@@ -125,6 +125,13 @@ public:
~FilteredAudioOutput();
/**
* Plugins shall call this method if they require an
* "audio_format" setting which evaluates
* AudioFormat::IsFullyDefined().
*/
void NeedFullyDefinedAudioFormat();
private:
void Configure(const ConfigBlock &block);
......
......@@ -62,6 +62,13 @@ FilteredAudioOutput::FilteredAudioOutput(const AudioOutputPlugin &_plugin,
Configure(block);
}
void
FilteredAudioOutput::NeedFullyDefinedAudioFormat()
{
if (!config_audio_format.IsFullyDefined())
throw std::runtime_error("Need full audio format specification");
}
static const AudioOutputPlugin *
audio_output_detect()
{
......
......@@ -117,9 +117,7 @@ ShoutOutput::ShoutOutput(const ConfigBlock &block)
shout_conn(shout_new()),
shout_meta(shout_metadata_new())
{
const AudioFormat audio_format = base.config_audio_format;
if (!audio_format.IsFullyDefined())
throw std::runtime_error("Need full audio format specification");
base.NeedFullyDefinedAudioFormat();
const char *host = require_block_string(block, "host");
const char *mount = require_block_string(block, "mount");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment