NetEq: Don't check sample rate and frame size upon error

If an error happens in the GetAudio call, for instance when corrupt
payloads are inserted, GetAudio wil return an error. In this case, the
audio frame is not always correctly populated, which is to be expected.

BUG=webrtc:5447

Review-Url: https://codereview.webrtc.org/2272963002
Cr-Commit-Position: refs/heads/master@{#13902}
This commit is contained in:
henrik.lundin
2016-08-24 11:18:49 -07:00
committed by Commit bot
parent d1a10a0f77
commit 5fac3f0892
2 changed files with 4 additions and 4 deletions

View File

@ -206,13 +206,13 @@ int NetEqImpl::GetAudio(AudioFrame* audio_frame, bool* muted) {
TRACE_EVENT0("webrtc", "NetEqImpl::GetAudio");
rtc::CritScope lock(&crit_sect_);
int error = GetAudioInternal(audio_frame, muted);
RTC_DCHECK_EQ(
audio_frame->sample_rate_hz_,
rtc::checked_cast<int>(audio_frame->samples_per_channel_ * 100));
if (error != 0) {
error_code_ = error;
return kFail;
}
RTC_DCHECK_EQ(
audio_frame->sample_rate_hz_,
rtc::checked_cast<int>(audio_frame->samples_per_channel_ * 100));
SetAudioFrameActivityAndType(vad_->enabled(), LastOutputType(),
last_vad_activity_, audio_frame);
last_vad_activity_ = audio_frame->vad_activity_;