diff options
author | Max Kellermann <max@duempel.org> | 2015-01-21 22:13:44 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-01-21 23:56:33 +0100 |
commit | 4fa5538e2bed36903b403e1aaee2462d22b456dc (patch) | |
tree | 292b66e10e6b97e2363fde34a81c027a67d3a9fe /src/encoder/plugins/VorbisEncoderPlugin.cxx | |
parent | 84e74173de85a3897cfe67150297987f8c8bf52e (diff) | |
download | mpd-4fa5538e2bed36903b403e1aaee2462d22b456dc.tar.gz mpd-4fa5538e2bed36903b403e1aaee2462d22b456dc.tar.xz mpd-4fa5538e2bed36903b403e1aaee2462d22b456dc.zip |
config/Param: split block-specific attributes to new struct ConfigBlock
The old struct config_param remains only for top-level string options.
Diffstat (limited to 'src/encoder/plugins/VorbisEncoderPlugin.cxx')
-rw-r--r-- | src/encoder/plugins/VorbisEncoderPlugin.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/encoder/plugins/VorbisEncoderPlugin.cxx b/src/encoder/plugins/VorbisEncoderPlugin.cxx index d84f33b84..11e057eaa 100644 --- a/src/encoder/plugins/VorbisEncoderPlugin.cxx +++ b/src/encoder/plugins/VorbisEncoderPlugin.cxx @@ -58,9 +58,9 @@ static constexpr Domain vorbis_encoder_domain("vorbis_encoder"); static bool vorbis_encoder_configure(struct vorbis_encoder &encoder, - const config_param ¶m, Error &error) + const ConfigBlock &block, Error &error) { - const char *value = param.GetBlockValue("quality"); + const char *value = block.GetBlockValue("quality"); if (value != nullptr) { /* a quality was configured (VBR) */ @@ -76,7 +76,7 @@ vorbis_encoder_configure(struct vorbis_encoder &encoder, return false; } - if (param.GetBlockValue("bitrate") != nullptr) { + if (block.GetBlockValue("bitrate") != nullptr) { error.Set(config_domain, "quality and bitrate are both defined"); return false; @@ -84,7 +84,7 @@ vorbis_encoder_configure(struct vorbis_encoder &encoder, } else { /* a bit rate was configured */ - value = param.GetBlockValue("bitrate"); + value = block.GetBlockValue("bitrate"); if (value == nullptr) { error.Set(config_domain, "neither bitrate nor quality defined"); @@ -106,12 +106,12 @@ vorbis_encoder_configure(struct vorbis_encoder &encoder, } static Encoder * -vorbis_encoder_init(const config_param ¶m, Error &error) +vorbis_encoder_init(const ConfigBlock &block, Error &error) { vorbis_encoder *encoder = new vorbis_encoder(); - /* load configuration from "param" */ - if (!vorbis_encoder_configure(*encoder, param, error)) { + /* load configuration from "block" */ + if (!vorbis_encoder_configure(*encoder, block, error)) { /* configuration has failed, roll back and return error */ delete encoder; return nullptr; |