Bug 930603: Ensure AEC known delay doesn't go negative (rev 4886 at webrtc.org) r=jib

This commit is contained in:
Randell Jesup 2013-10-25 18:21:33 -04:00
Родитель ee44a34705
Коммит 0bae0b30b9
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -814,13 +814,18 @@ static void ProcessExtended(aecpc_t* self, const int16_t* near,
EstBufDelayExtended(self);
for (i = 0; i < num_frames; ++i) {
{
// |delay_diff_offset| gives us the option to manually rewind the delay on
// very low delay platforms which can't be expressed purely through
// |reported_delay_ms|.
WebRtcAec_ProcessFrame(self->aec, &near[FRAME_LEN * i],
&near_high[FRAME_LEN * i], self->knownDelay + delay_diff_offset,
&out[FRAME_LEN * i], &out_high[FRAME_LEN * i]);
const int adjusted_known_delay =
WEBRTC_SPL_MAX(0, self->knownDelay + delay_diff_offset);
for (i = 0; i < num_frames; ++i) {
WebRtcAec_ProcessFrame(self->aec, &near[FRAME_LEN * i],
&near_high[FRAME_LEN * i], adjusted_known_delay,
&out[FRAME_LEN * i], &out_high[FRAME_LEN * i]);
}
}
}