FS-11014 FS-11404 fix libfvad might be enabled unexpectedly when set_mode is called

This commit is contained in:
Seven Du 2018-09-22 16:51:39 +08:00 committed by Mike Jerris
parent 95b66126c5
commit 0de57c07d8
1 changed files with 3 additions and 2 deletions

View File

@ -95,8 +95,9 @@ SWITCH_DECLARE(int) switch_vad_set_mode(switch_vad_t *vad, int mode)
#ifdef SWITCH_HAVE_FVAD
int ret = 0;
if (mode < 0 && vad->fvad) {
fvad_free(vad->fvad);
if (mode < 0) {
if (vad->fvad) fvad_free(vad->fvad);
vad->fvad = NULL;
return ret;
} else if (mode > 3) {