From ca0d09c50fc4246fdae67b8a33799ea580b68593 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Aug 2013 12:24:36 +0200 Subject: EncoderPlugin: pass config_param reference --- src/encoder/TwolameEncoderPlugin.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/encoder/TwolameEncoderPlugin.cxx') diff --git a/src/encoder/TwolameEncoderPlugin.cxx b/src/encoder/TwolameEncoderPlugin.cxx index 4e2d47b63..cd85e43b6 100644 --- a/src/encoder/TwolameEncoderPlugin.cxx +++ b/src/encoder/TwolameEncoderPlugin.cxx @@ -48,7 +48,7 @@ struct TwolameEncoder final { TwolameEncoder():encoder(twolame_encoder_plugin) {} - bool Configure(const config_param *param, GError **error); + bool Configure(const config_param ¶m, GError **error); }; static inline GQuark @@ -58,12 +58,12 @@ twolame_encoder_quark(void) } bool -TwolameEncoder::Configure(const config_param *param, GError **error) +TwolameEncoder::Configure(const config_param ¶m, GError **error) { const char *value; char *endptr; - value = config_get_block_string(param, "quality", nullptr); + value = param.GetBlockValue("quality"); if (value != nullptr) { /* a quality was configured (VBR) */ @@ -73,26 +73,26 @@ TwolameEncoder::Configure(const config_param *param, GError **error) g_set_error(error, twolame_encoder_quark(), 0, "quality \"%s\" is not a number in the " "range -1 to 10, line %i", - value, param->line); + value, param.line); return false; } - if (config_get_block_string(param, "bitrate", nullptr) != nullptr) { + if (param.GetBlockValue("bitrate") != nullptr) { g_set_error(error, twolame_encoder_quark(), 0, "quality and bitrate are " "both defined (line %i)", - param->line); + param.line); return false; } } else { /* a bit rate was configured */ - value = config_get_block_string(param, "bitrate", nullptr); + value = param.GetBlockValue("bitrate"); if (value == nullptr) { g_set_error(error, twolame_encoder_quark(), 0, "neither bitrate nor quality defined " "at line %i", - param->line); + param.line); return false; } @@ -102,7 +102,7 @@ TwolameEncoder::Configure(const config_param *param, GError **error) if (*endptr != '\0' || bitrate <= 0) { g_set_error(error, twolame_encoder_quark(), 0, "bitrate at line %i should be a positive integer", - param->line); + param.line); return false; } } @@ -111,7 +111,7 @@ TwolameEncoder::Configure(const config_param *param, GError **error) } static Encoder * -twolame_encoder_init(const struct config_param *param, GError **error_r) +twolame_encoder_init(const config_param ¶m, GError **error_r) { g_debug("libtwolame version %s", get_twolame_version()); -- cgit v1.2.3