diff options
author | Moonchild <moonchild@palemoon.org> | 2020-11-19 22:32:24 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-11-19 22:32:24 +0000 |
commit | a89597b5db753b369347a3ad4e3e8f6216b1c3ac (patch) | |
tree | 5f91a3f717ecc1e1513fea6dbf6fd60c918bed10 /media | |
parent | 074d194776b5928a3d8cdf6046af5f65b67ff7df (diff) | |
download | UXP-a89597b5db753b369347a3ad4e3e8f6216b1c3ac.tar UXP-a89597b5db753b369347a3ad4e3e8f6216b1c3ac.tar.gz UXP-a89597b5db753b369347a3ad4e3e8f6216b1c3ac.tar.lz UXP-a89597b5db753b369347a3ad4e3e8f6216b1c3ac.tar.xz UXP-a89597b5db753b369347a3ad4e3e8f6216b1c3ac.zip |
[webrtc] Only init WebRtcAec callbacks once
Diffstat (limited to 'media')
-rw-r--r-- | media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_core.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_core.c b/media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_core.c index 470c422db..1722ba82e 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_core.c +++ b/media/webrtc/trunk/webrtc/modules/audio_processing/aec/aec_core.c @@ -23,6 +23,7 @@ #include <stddef.h> // size_t #include <stdlib.h> #include <string.h> +#include <stdbool.h> #include "webrtc/common_audio/ring_buffer.h" #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" @@ -1573,33 +1574,36 @@ AecCore* WebRtcAec_CreateAec() { #endif aec->extended_filter_enabled = 0; - // Assembly optimization - WebRtcAec_FilterFar = FilterFar; - WebRtcAec_ScaleErrorSignal = ScaleErrorSignal; - WebRtcAec_FilterAdaptation = FilterAdaptation; - WebRtcAec_OverdriveAndSuppress = OverdriveAndSuppress; - WebRtcAec_ComfortNoise = ComfortNoise; - WebRtcAec_SubbandCoherence = SubbandCoherence; + static bool initted = false; + if (!initted) { + initted = true; + // Assembly optimization + WebRtcAec_FilterFar = FilterFar; + WebRtcAec_ScaleErrorSignal = ScaleErrorSignal; + WebRtcAec_FilterAdaptation = FilterAdaptation; + WebRtcAec_OverdriveAndSuppress = OverdriveAndSuppress; + WebRtcAec_ComfortNoise = ComfortNoise; + WebRtcAec_SubbandCoherence = SubbandCoherence; #if defined(WEBRTC_ARCH_X86_FAMILY) - if (WebRtc_GetCPUInfo(kSSE2)) { - WebRtcAec_InitAec_SSE2(); - } + if (WebRtc_GetCPUInfo(kSSE2)) { + WebRtcAec_InitAec_SSE2(); + } #endif #if defined(MIPS_FPU_LE) - WebRtcAec_InitAec_mips(); + WebRtcAec_InitAec_mips(); #endif #if defined(WEBRTC_ARCH_ARM_NEON) - WebRtcAec_InitAec_neon(); -#elif defined(WEBRTC_DETECT_ARM_NEON) - if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { WebRtcAec_InitAec_neon(); - } +#elif defined(WEBRTC_DETECT_ARM_NEON) + if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { + WebRtcAec_InitAec_neon(); + } #endif - - aec_rdft_init(); + aec_rdft_init(); + } return aec; } |