diff options
author | bjornv@webrtc.org <bjornv@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-02-20 17:31:38 +0000 |
---|---|---|
committer | bjornv@webrtc.org <bjornv@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-02-20 17:31:38 +0000 |
commit | d6bf01e7f91e5db2fbdaeeb4949c92842d732a3d (patch) | |
tree | cc86ef87c07b4b42741ff8f2514a255be8dd637a /modules/audio_processing/aec/echo_cancellation.c | |
parent | 06c66e0fd7e2bf7a08a2e1feaec0182a2c7cdb4f (diff) | |
download | webrtc-d6bf01e7f91e5db2fbdaeeb4949c92842d732a3d.tar.gz |
Added a pointer getter to the system_delay variable.
Tested with audioproc_unittest, trybots
TEST=None
BUG=None
Review URL: https://webrtc-codereview.appspot.com/1101015
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3549 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'modules/audio_processing/aec/echo_cancellation.c')
-rw-r--r-- | modules/audio_processing/aec/echo_cancellation.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/audio_processing/aec/echo_cancellation.c b/modules/audio_processing/aec/echo_cancellation.c index de26c67c..04789e7f 100644 --- a/modules/audio_processing/aec/echo_cancellation.c +++ b/modules/audio_processing/aec/echo_cancellation.c @@ -268,7 +268,8 @@ WebRtc_Word32 WebRtcAec_BufferFarend(void *aecInst, const WebRtc_Word16 *farend, farend_ptr = (const int16_t*) newFarend; } - aecpc->aec->system_delay += newNrOfSamples; + WebRtcAec_SetSystemDelay(aecpc->aec, WebRtcAec_system_delay(aecpc->aec) + + newNrOfSamples); #ifdef WEBRTC_AEC_DEBUG_DUMP WebRtc_WriteBuffer(aecpc->far_pre_buf_s16, farend_ptr, @@ -454,7 +455,8 @@ WebRtc_Word32 WebRtcAec_Process(void *aecInst, const WebRtc_Word16 *nearend, // for too long). When the far-end buffer is filled with // approximately the same amount of data as reported by the system // we end the startup phase. - int overhead_elements = aecpc->aec->system_delay / PART_LEN - + int overhead_elements = + WebRtcAec_system_delay(aecpc->aec) / PART_LEN - aecpc->bufSizeStart; if (overhead_elements == 0) { // Enable the AEC @@ -493,7 +495,7 @@ WebRtc_Word32 WebRtcAec_Process(void *aecInst, const WebRtc_Word16 *nearend, #ifdef WEBRTC_AEC_DEBUG_DUMP { - int16_t far_buf_size_ms = (int16_t)(aecpc->aec->system_delay / + int16_t far_buf_size_ms = (int16_t)(WebRtcAec_system_delay(aecpc->aec) / (sampMsNb * aecpc->rate_factor)); (void)fwrite(&far_buf_size_ms, 2, 1, aecpc->bufFile); (void)fwrite(&aecpc->knownDelay, sizeof(aecpc->knownDelay), 1, @@ -700,7 +702,7 @@ WebRtc_Word32 WebRtcAec_get_error_code(void *aecInst) static int EstBufDelay(aecpc_t* aecpc) { int nSampSndCard = aecpc->msInSndCardBuf * sampMsNb * aecpc->rate_factor; - int current_delay = nSampSndCard - aecpc->aec->system_delay; + int current_delay = nSampSndCard - WebRtcAec_system_delay(aecpc->aec); int delay_difference = 0; // Before we proceed with the delay estimate filtering we: |