aboutsummaryrefslogtreecommitdiffstats
path: root/main/dsp.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-26 19:16:31 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-26 19:16:31 +0000
commit2024fbae3fe21fcd1f9ab5c7215791ed57f959fe (patch)
treef30acea4c199bba7f7b7c9cb1baf6f1bfc757b8e /main/dsp.c
parentd6d48c93f66df55e3c40811f0c3bb5f3c5f61549 (diff)
Only try to detect silence when we actually need to, instead of...always.
If this is wrong, I'd love to hear why. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@111028 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/dsp.c')
-rw-r--r--main/dsp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main/dsp.c b/main/dsp.c
index 084a37cfb..f2d47df59 100644
--- a/main/dsp.c
+++ b/main/dsp.c
@@ -1301,7 +1301,11 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp,
/* Initially we do not want to mute anything */
dsp->mute_fragments = 0;
- res = __ast_dsp_silence_noise(dsp, shortdata, len, &silence, NULL);
+ /* Need to run the silence detection stuff for silence suppression and busy detection */
+ if ((dsp->features & DSP_FEATURE_SILENCE_SUPPRESS) || (dsp->features & DSP_FEATURE_BUSY_DETECT)) {
+ res = __ast_dsp_silence_noise(dsp, shortdata, len, &silence, NULL);
+ }
+
if ((dsp->features & DSP_FEATURE_SILENCE_SUPPRESS) && silence) {
memset(&dsp->f, 0, sizeof(dsp->f));
dsp->f.frametype = AST_FRAME_NULL;