Add Opus threshold config variable
authorMartin Johansson <martin@fatbob.nu>
Mon, 26 Nov 2012 22:00:29 +0000 (23:00 +0100)
committerMartin Johansson <martin@fatbob.nu>
Tue, 5 Feb 2013 20:29:29 +0000 (21:29 +0100)
src/conf.c
src/conf.h

index ccd8e05cde4dfefe3f8d7bd468569de9ddca24ad..efacd56e6bae6ed10ee773efdcd7922eb41adcda 100644 (file)
@@ -45,6 +45,7 @@ static config_t configuration;
 #define DEFAULT_MAX_BANDWIDTH 48000
 #define DEFAULT_BINDPORT 64738
 #define DEFAULT_BAN_LENGTH (60*60)
+#define DEFAULT_OPUS_THRESHOLD 100
 
 const char defaultconfig[] = DEFAULT_CONFIG;
 
@@ -250,6 +251,14 @@ int getIntConf(param_t param)
                        return config_setting_get_int(setting);
                }
                break;
+       case OPUS_THRESHOLD:
+               setting = config_lookup(&configuration, "opus_threshold");
+               if (!setting)
+                       return DEFAULT_OPUS_THRESHOLD;
+               else {
+                       return config_setting_get_int(setting);
+               }
+               break;
        default:
                doAssert(false);
        }
index ea43e38ccc1803858898ac7c4b6496731112cf51..c9793eb79cde76db9ed95f54c808552f96672ca8 100644 (file)
@@ -54,6 +54,7 @@ typedef enum param {
        ENABLE_BAN,
        BANFILE,
        SYNC_BANFILE,
+       OPUS_THRESHOLD,
 } param_t;
 
 typedef struct {