From 4fa5538e2bed36903b403e1aaee2462d22b456dc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 21 Jan 2015 22:13:44 +0100 Subject: config/Param: split block-specific attributes to new struct ConfigBlock The old struct config_param remains only for top-level string options. --- src/encoder/plugins/VorbisEncoderPlugin.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/encoder/plugins/VorbisEncoderPlugin.cxx') 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; -- cgit v1.2.3