]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6209 don't change behavior from defaults if the values aren't defined
authorBrian West <brian@freeswitch.org>
Thu, 27 Feb 2014 21:29:25 +0000 (15:29 -0600)
committerBrian West <brian@freeswitch.org>
Thu, 27 Feb 2014 21:29:25 +0000 (15:29 -0600)
src/mod/codecs/mod_opus/mod_opus.c

index 96ff9ebde15e777e2a3d2aa3af9c561b09cbd04e..7fae227ab7cfc7d25246630264e93ad81c4bd19e 100644 (file)
@@ -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));
                }