[Asterisk-cvs] asterisk/codecs codec_speex.c,1.7,1.8
citats at lists.digium.com
citats at lists.digium.com
Fri Oct 1 09:14:36 CDT 2004
Update of /usr/cvsroot/asterisk/codecs
In directory mongoose.digium.com:/home/citats/cvs/asterisk/codecs
Modified Files:
codec_speex.c
Log Message:
Code formatting cleanup
Index: codec_speex.c
===================================================================
RCS file: /usr/cvsroot/asterisk/codecs/codec_speex.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- codec_speex.c 1 Oct 2004 03:18:48 -0000 1.7
+++ codec_speex.c 1 Oct 2004 13:16:44 -0000 1.8
@@ -24,8 +24,6 @@
static int abr_quality = 0;
static int dtx = 0;
-
-
#define TYPE_SILENCE 0x2
#define TYPE_HIGH 0x0
#define TYPE_LOW 0x1
@@ -87,19 +85,18 @@
speex_encoder_ctl(tmp->speex, SPEEX_SET_QUALITY, &quality);
speex_encoder_ctl(tmp->speex, SPEEX_SET_COMPLEXITY, &complexity);
- if(vad)
+ if (vad)
speex_encoder_ctl(tmp->speex, SPEEX_SET_VAD, &vad);
- if(dtx)
+ if (dtx)
speex_encoder_ctl(tmp->speex, SPEEX_SET_DTX, &vad);
- if(vbr) {
+ if (vbr) {
speex_encoder_ctl(tmp->speex, SPEEX_SET_VBR, &vbr);
speex_encoder_ctl(tmp->speex, SPEEX_SET_VBR_QUALITY, &vbr_quality);
}
- if(abr) {
+ if (abr) {
speex_encoder_ctl(tmp->speex, SPEEX_SET_VBR, &abr);
speex_encoder_ctl(tmp->speex, SPEEX_SET_VBR_QUALITY, &abr_quality);
}
-
tmp->tail = 0;
}
localusecnt++;
@@ -118,7 +115,7 @@
} else {
speex_bits_init(&tmp->bits);
speex_decoder_ctl(tmp->speex, SPEEX_GET_FRAME_SIZE, &tmp->framesize);
- if(enhancement)
+ if (enhancement)
speex_decoder_ctl(tmp->speex, SPEEX_SET_ENH, &enhancement);
tmp->tail = 0;
}
@@ -305,51 +302,55 @@
};
-static void parse_config(void) {
+static void parse_config(void)
+{
struct ast_config *cfg;
struct ast_variable *var;
int res;
+
if ((cfg = ast_load("codecs.conf"))) {
if ((var = ast_variable_browse(cfg, "speex"))) {
while (var) {
if (!strcasecmp(var->name, "quality")) {
res = abs(atoi(var->value));
- if(res > -1 && res < 11) {
+ if (res > -1 && res < 11) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Quality to %d\n",res);
ast_mutex_lock(&localuser_lock);
quality = res;
ast_mutex_unlock(&localuser_lock);
- } else ast_log(LOG_ERROR,"Error Quality must be 0-10\n");
-
+ } else
+ ast_log(LOG_ERROR,"Error Quality must be 0-10\n");
} else if (!strcasecmp(var->name, "complexity")) {
res = abs(atoi(var->value));
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Complexity to %d\n",res);
- if(res > -1 && res < 11) {
+ if (res > -1 && res < 11) {
ast_mutex_lock(&localuser_lock);
complexity = res;
ast_mutex_unlock(&localuser_lock);
- } else ast_log(LOG_ERROR,"Error! Complexity must be 0-10\n");
+ } else
+ ast_log(LOG_ERROR,"Error! Complexity must be 0-10\n");
} else if (!strcasecmp(var->name, "vbr_quality")) {
res = abs(atoi(var->value));
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting VBR Quality to %d\n",res);
- if(res > -1 && res < 11) {
+ if (res > -1 && res < 11) {
ast_mutex_lock(&localuser_lock);
vbr_quality = res;
ast_mutex_unlock(&localuser_lock);
- } else ast_log(LOG_ERROR,"Error! VBR Quality must be 0-10\n");
+ } else
+ ast_log(LOG_ERROR,"Error! VBR Quality must be 0-10\n");
} else if (!strcasecmp(var->name, "abr_quality")) {
res = abs(atoi(var->value));
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting ABR Quality to %d\n",res);
- if(res > -1 && res < 11) {
+ if (res > -1 && res < 11) {
ast_mutex_lock(&localuser_lock);
abr_quality = res;
ast_mutex_unlock(&localuser_lock);
- } else ast_log(LOG_ERROR,"Error! ABR Quality must be 0-10\n");
-
+ } else
+ ast_log(LOG_ERROR,"Error! ABR Quality must be 0-10\n");
} else if (!strcasecmp(var->name, "enhancement")) {
ast_mutex_lock(&localuser_lock);
enhancement = ast_true(var->value) ? 1 : 0;
@@ -387,7 +388,8 @@
}
}
-int reload(void) {
+int reload(void)
+{
parse_config();
return 0;
}
More information about the svn-commits
mailing list