From 5ce389db05618d6b1282892a9005b8ad6eeb8a7f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 3 May 2017 13:48:03 -0500 Subject: [PATCH] FS-9958: [freeswitch-core,mod_local_stream] Add agc object and use it in mod_local_stream --- src/mod/formats/mod_local_stream/mod_local_stream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mod/formats/mod_local_stream/mod_local_stream.c b/src/mod/formats/mod_local_stream/mod_local_stream.c index 2848835dd7..5f9dd2484d 100644 --- a/src/mod/formats/mod_local_stream/mod_local_stream.c +++ b/src/mod/formats/mod_local_stream/mod_local_stream.c @@ -1404,7 +1404,7 @@ SWITCH_STANDARD_API(local_stream_function) stream->write_function(stream, "-ERR invalid auto-volume level for stream: %s\n", source->name); } else { if (!source->agc) { - switch_agc_create(&source->agc, source->energy_avg, source->energy_low, 500, 3, (1000 / source->interval) * 2); + switch_agc_create(&source->agc, source->energy_avg, source->energy_low, 10, 3, (1000 / source->interval) * 2); } else { switch_agc_set_energy_avg(source->agc, source->energy_avg); switch_agc_set_energy_low(source->agc, source->energy_low); @@ -1413,6 +1413,9 @@ SWITCH_STANDARD_API(local_stream_function) } else { source->vol = atoi(argv[2]); switch_normalize_volume_granular(source->vol); + if (source->agc) { + switch_agc_destroy(&source->agc); + } } }