From 4516668db9a2bbf42eb99cffa0355623fc997a36 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 27 Feb 2014 15:29:25 -0600 Subject: [PATCH] FS-6209 don't change behavior from defaults if the values aren't defined --- src/mod/codecs/mod_opus/mod_opus.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mod/codecs/mod_opus/mod_opus.c b/src/mod/codecs/mod_opus/mod_opus.c index 96ff9ebde1..7fae227ab7 100644 --- a/src/mod/codecs/mod_opus/mod_opus.c +++ b/src/mod/codecs/mod_opus/mod_opus.c @@ -284,9 +284,13 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag opus_encoder_ctl(context->encoder_object, OPUS_SET_BANDWIDTH(OPUS_BANDWIDTH_FULLBAND)); } - opus_encoder_ctl(context->encoder_object, OPUS_SET_VBR(use_vbr)); - opus_encoder_ctl(context->encoder_object, OPUS_SET_COMPLEXITY(complexity)); - + if (use_vbr) { + opus_encoder_ctl(context->encoder_object, OPUS_SET_VBR(use_vbr)); + } + if (complexity) { + opus_encoder_ctl(context->encoder_object, OPUS_SET_COMPLEXITY(complexity)); + } + if (opus_codec_settings.useinbandfec) { opus_encoder_ctl(context->encoder_object, OPUS_SET_INBAND_FEC(opus_codec_settings.useinbandfec)); }