mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-23 21:19:09 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@111028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user