diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-26 15:49:18 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-26 15:49:18 +0000 |
commit | 4f3c4dc7f238b64a21172be86266311c9c645c77 (patch) | |
tree | de4bd130dafa592858306d2ac6bcc5f85fd51cc8 /codecs | |
parent | 07772bc9e3ef6636a3e99e07d2aea3a06988f0c9 (diff) |
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: http://svn.digium.com/svn/asterisk/trunk@77299 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs')
-rw-r--r-- | codecs/codec_adpcm.c | 3 | ||||
-rw-r--r-- | codecs/codec_alaw.c | 3 | ||||
-rw-r--r-- | codecs/codec_g722.c | 3 | ||||
-rw-r--r-- | codecs/codec_g726.c | 3 | ||||
-rw-r--r-- | codecs/codec_gsm.c | 3 | ||||
-rw-r--r-- | codecs/codec_lpc10.c | 3 | ||||
-rw-r--r-- | codecs/codec_speex.c | 51 | ||||
-rw-r--r-- | codecs/codec_ulaw.c | 3 | ||||
-rw-r--r-- | codecs/codec_zap.c | 10 |
9 files changed, 28 insertions, 54 deletions
diff --git a/codecs/codec_adpcm.c b/codecs/codec_adpcm.c index 7469f056c..fb4bb8bd7 100644 --- a/codecs/codec_adpcm.c +++ b/codecs/codec_adpcm.c @@ -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); diff --git a/codecs/codec_alaw.c b/codecs/codec_alaw.c index de1061687..9edae5130 100644 --- a/codecs/codec_alaw.c +++ b/codecs/codec_alaw.c @@ -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); diff --git a/codecs/codec_g722.c b/codecs/codec_g722.c index e046b9337..46d34f1ba 100644 --- a/codecs/codec_g722.c +++ b/codecs/codec_g722.c @@ -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 "); } } diff --git a/codecs/codec_g726.c b/codecs/codec_g726.c index bfc49ad9c..425ba9bef 100644 --- a/codecs/codec_g726.c +++ b/codecs/codec_g726.c @@ -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 "); } } diff --git a/codecs/codec_gsm.c b/codecs/codec_gsm.c index 8a3749319..c346f24cf 100644 --- a/codecs/codec_gsm.c +++ b/codecs/codec_gsm.c @@ -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); diff --git a/codecs/codec_lpc10.c b/codecs/codec_lpc10.c index 723c5d8ce..d4688cd9b 100644 --- a/codecs/codec_lpc10.c +++ b/codecs/codec_lpc10.c @@ -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 "); } } diff --git a/codecs/codec_speex.c b/codecs/codec_speex.c index 182b33eb9..1cbd5d9fb 100644 --- a/codecs/codec_speex.c +++ b/codecs/codec_speex.c @@ -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"); diff --git a/codecs/codec_ulaw.c b/codecs/codec_ulaw.c index 334f8d9ad..ce248f1c1 100644 --- a/codecs/codec_ulaw.c +++ b/codecs/codec_ulaw.c @@ -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); diff --git a/codecs/codec_zap.c b/codecs/codec_zap.c index 9073f9545..9204baad7 100644 --- a/codecs/codec_zap.c +++ b/codecs/codec_zap.c @@ -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++) { |