mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
Do a massive conversion for using the ast_verb() macro
(closes issue #10277, patches by mvanbaak) Basically, this changes ... if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3, "Something\n"); to ... ast_verb(3, "Something\n"); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -359,8 +359,7 @@ static void parse_config(void)
|
||||
for (var = ast_variable_browse(cfg, "plc"); var ; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
adpcmtolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "codec_adpcm: %susing generic PLC\n", adpcmtolin.useplc ? "" : "not ");
|
||||
ast_verb(3, "codec_adpcm: %susing generic PLC\n", adpcmtolin.useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
|
@@ -143,8 +143,7 @@ static void parse_config(void)
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
alawtolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
|
||||
ast_verb(3, "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
|
@@ -174,8 +174,7 @@ static void parse_config(void)
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
g722tolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "codec_g722: %susing generic PLC\n",
|
||||
ast_verb(3, "codec_g722: %susing generic PLC\n",
|
||||
g722tolin.useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
|
@@ -904,8 +904,7 @@ static void parse_config(void)
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
g726tolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "codec_g726: %susing generic PLC\n",
|
||||
ast_verb(3, "codec_g726: %susing generic PLC\n",
|
||||
g726tolin.useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
|
@@ -244,8 +244,7 @@ static void parse_config(void)
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
gsmtolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "codec_gsm: %susing generic PLC\n", gsmtolin.useplc ? "" : "not ");
|
||||
ast_verb(3, "codec_gsm: %susing generic PLC\n", gsmtolin.useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
|
@@ -270,8 +270,7 @@ static void parse_config(void)
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
lpc10tolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "codec_lpc10: %susing generic PLC\n",
|
||||
ast_verb(3, "codec_lpc10: %susing generic PLC\n",
|
||||
lpc10tolin.useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
|
@@ -389,23 +389,20 @@ static void parse_config(void)
|
||||
if (!strcasecmp(var->name, "quality")) {
|
||||
res = abs(atoi(var->value));
|
||||
if (res > -1 && res < 11) {
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Quality to %d\n",res);
|
||||
ast_verb(3, "CODEC SPEEX: Setting Quality to %d\n",res);
|
||||
quality = res;
|
||||
} else
|
||||
ast_log(LOG_ERROR,"Error Quality must be 0-10\n");
|
||||
} else if (!strcasecmp(var->name, "complexity")) {
|
||||
res = abs(atoi(var->value));
|
||||
if (res > -1 && res < 11) {
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting Complexity to %d\n",res);
|
||||
ast_verb(3, "CODEC SPEEX: Setting Complexity to %d\n",res);
|
||||
complexity = res;
|
||||
} else
|
||||
ast_log(LOG_ERROR,"Error! Complexity must be 0-10\n");
|
||||
} else if (!strcasecmp(var->name, "vbr_quality")) {
|
||||
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0 && res_f <= 10) {
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting VBR Quality to %f\n",res_f);
|
||||
ast_verb(3, "CODEC SPEEX: Setting VBR Quality to %f\n",res_f);
|
||||
vbr_quality = res_f;
|
||||
} else
|
||||
ast_log(LOG_ERROR,"Error! VBR Quality must be 0-10\n");
|
||||
@@ -413,70 +410,56 @@ static void parse_config(void)
|
||||
ast_log(LOG_ERROR,"Error! ABR Quality setting obsolete, set ABR to desired bitrate\n");
|
||||
} else if (!strcasecmp(var->name, "enhancement")) {
|
||||
enhancement = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Perceptual Enhancement Mode. [%s]\n",enhancement ? "on" : "off");
|
||||
ast_verb(3, "CODEC SPEEX: Perceptual Enhancement Mode. [%s]\n",enhancement ? "on" : "off");
|
||||
} else if (!strcasecmp(var->name, "vbr")) {
|
||||
vbr = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: VBR Mode. [%s]\n",vbr ? "on" : "off");
|
||||
ast_verb(3, "CODEC SPEEX: VBR Mode. [%s]\n",vbr ? "on" : "off");
|
||||
} else if (!strcasecmp(var->name, "abr")) {
|
||||
res = abs(atoi(var->value));
|
||||
if (res >= 0) {
|
||||
if (option_verbose > 2) {
|
||||
if (res > 0)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting ABR target bitrate to %d\n",res);
|
||||
ast_verb(3, "CODEC SPEEX: Setting ABR target bitrate to %d\n",res);
|
||||
else
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Disabling ABR\n");
|
||||
}
|
||||
ast_verb(3, "CODEC SPEEX: Disabling ABR\n");
|
||||
abr = res;
|
||||
} else
|
||||
ast_log(LOG_ERROR,"Error! ABR target bitrate must be >= 0\n");
|
||||
} else if (!strcasecmp(var->name, "vad")) {
|
||||
vad = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: VAD Mode. [%s]\n",vad ? "on" : "off");
|
||||
ast_verb(3, "CODEC SPEEX: VAD Mode. [%s]\n",vad ? "on" : "off");
|
||||
} else if (!strcasecmp(var->name, "dtx")) {
|
||||
dtx = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: DTX Mode. [%s]\n",dtx ? "on" : "off");
|
||||
ast_verb(3, "CODEC SPEEX: DTX Mode. [%s]\n",dtx ? "on" : "off");
|
||||
} else if (!strcasecmp(var->name, "preprocess")) {
|
||||
preproc = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessing. [%s]\n",preproc ? "on" : "off");
|
||||
ast_verb(3, "CODEC SPEEX: Preprocessing. [%s]\n",preproc ? "on" : "off");
|
||||
} else if (!strcasecmp(var->name, "pp_vad")) {
|
||||
pp_vad = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor VAD. [%s]\n",pp_vad ? "on" : "off");
|
||||
ast_verb(3, "CODEC SPEEX: Preprocessor VAD. [%s]\n",pp_vad ? "on" : "off");
|
||||
} else if (!strcasecmp(var->name, "pp_agc")) {
|
||||
pp_agc = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor AGC. [%s]\n",pp_agc ? "on" : "off");
|
||||
ast_verb(3, "CODEC SPEEX: Preprocessor AGC. [%s]\n",pp_agc ? "on" : "off");
|
||||
} else if (!strcasecmp(var->name, "pp_agc_level")) {
|
||||
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f);
|
||||
ast_verb(3, "CODEC SPEEX: Setting preprocessor AGC Level to %f\n",res_f);
|
||||
pp_agc_level = res_f;
|
||||
} else
|
||||
ast_log(LOG_ERROR,"Error! Preprocessor AGC Level must be >= 0\n");
|
||||
} else if (!strcasecmp(var->name, "pp_denoise")) {
|
||||
pp_denoise = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor Denoise. [%s]\n",pp_denoise ? "on" : "off");
|
||||
ast_verb(3, "CODEC SPEEX: Preprocessor Denoise. [%s]\n",pp_denoise ? "on" : "off");
|
||||
} else if (!strcasecmp(var->name, "pp_dereverb")) {
|
||||
pp_dereverb = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Preprocessor Dereverb. [%s]\n",pp_dereverb ? "on" : "off");
|
||||
ast_verb(3, "CODEC SPEEX: Preprocessor Dereverb. [%s]\n",pp_dereverb ? "on" : "off");
|
||||
} else if (!strcasecmp(var->name, "pp_dereverb_decay")) {
|
||||
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor Dereverb Decay to %f\n",res_f);
|
||||
ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Decay to %f\n",res_f);
|
||||
pp_dereverb_decay = res_f;
|
||||
} else
|
||||
ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Decay must be >= 0\n");
|
||||
} else if (!strcasecmp(var->name, "pp_dereverb_level")) {
|
||||
if (sscanf(var->value, "%f", &res_f) == 1 && res_f >= 0) {
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f);
|
||||
ast_verb(3, "CODEC SPEEX: Setting preprocessor Dereverb Level to %f\n",res_f);
|
||||
pp_dereverb_level = res_f;
|
||||
} else
|
||||
ast_log(LOG_ERROR,"Error! Preprocessor Dereverb Level must be >= 0\n");
|
||||
|
@@ -156,8 +156,7 @@ static void parse_config(void)
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
ulawtolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "codec_ulaw: %susing generic PLC\n", ulawtolin.useplc ? "" : "not ");
|
||||
ast_verb(3, "codec_ulaw: %susing generic PLC\n", ulawtolin.useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
|
@@ -323,8 +323,7 @@ static void parse_config(void)
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
global_useplc = ast_true(var->value);
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "codec_zap: %susing generic PLC\n",
|
||||
ast_verb(3, "codec_zap: %susing generic PLC\n",
|
||||
global_useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
@@ -366,14 +365,13 @@ static int find_transcoders(void)
|
||||
return 0;
|
||||
}
|
||||
for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) {
|
||||
if (option_verbose > 1)
|
||||
ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name);
|
||||
ast_verb(2, "Found transcoder '%s'.\n", info.name);
|
||||
build_translators(&map, info.dstfmts, info.srcfmts);
|
||||
}
|
||||
close(fd);
|
||||
|
||||
if (!info.tcnum && (option_verbose > 1))
|
||||
ast_verbose(VERBOSE_PREFIX_2 "No hardware transcoders found.\n");
|
||||
if (!info.tcnum)
|
||||
ast_verb(2, "No hardware transcoders found.\n");
|
||||
|
||||
for (x = 0; x < 32; x++) {
|
||||
for (y = 0; y < 32; y++) {
|
||||
|
Reference in New Issue
Block a user