]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7830: mod_opus: added use-dtx param in config file (enables DTX on the encoder...
authorDragos Oancea <droancea@yahoo.com>
Mon, 13 Jul 2015 22:10:10 +0000 (18:10 -0400)
committerDragos Oancea <droancea@yahoo.com>
Mon, 13 Jul 2015 22:12:11 +0000 (18:12 -0400)
src/mod/codecs/mod_opus/mod_opus.c

index 75e2ed973fc2e6a374ea0bf57abf72501058cc73..1f7c7a1c8628cd15483b2a446fdabd99ec54c2bf 100644 (file)
@@ -81,6 +81,7 @@ struct opus_context {
 
 struct {
     int use_vbr;
+    int use_dtx;
     int complexity;
     int maxaveragebitrate;
     int maxplaybackrate;
@@ -347,6 +348,8 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag
 
        opus_codec_settings.cbr = !opus_prefs.use_vbr;
 
+       opus_codec_settings.usedtx = opus_prefs.use_dtx;
+
        codec->fmtp_out = gen_fmtp(&opus_codec_settings, codec->memory_pool);
 
        if (encoding) {
@@ -604,6 +607,8 @@ static switch_status_t opus_load_config(switch_bool_t reload)
                        
                        if (!strcasecmp(key, "use-vbr") && !zstr(val)) {
                                opus_prefs.use_vbr = atoi(val);
+                       } else if (!strcasecmp(key, "use-dtx")) {
+                               opus_prefs.use_dtx = atoi(val);
                        } else if (!strcasecmp(key, "complexity")) {
                                opus_prefs.complexity = atoi(val);
                        } else if (!strcasecmp(key, "packet-loss-percent")) {