Avoid crashing on error code 6450 in isac.
Isac is not able to effectively compress all types of signals. This should be extremely rare with real audio signals, but mostly happens with artificially created test signals. When this happens, we should avoid crashing and just carry on. Bug: chromium:1170167 Change-Id: I97b551fbbdcccb0186f3e6497991ac52d2301f68 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205626 Commit-Queue: Ivo Creusen <ivoc@webrtc.org> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33193}
This commit is contained in:
@ -140,6 +140,11 @@ AudioEncoder::EncodedInfo AudioEncoderIsacT<T>::EncodeImpl(
|
|||||||
kSufficientEncodeBufferSizeBytes, [&](rtc::ArrayView<uint8_t> encoded) {
|
kSufficientEncodeBufferSizeBytes, [&](rtc::ArrayView<uint8_t> encoded) {
|
||||||
int r = T::Encode(isac_state_, audio.data(), encoded.data());
|
int r = T::Encode(isac_state_, audio.data(), encoded.data());
|
||||||
|
|
||||||
|
if (T::GetErrorCode(isac_state_) == 6450) {
|
||||||
|
// Isac is not able to effectively compress all types of signals. This
|
||||||
|
// is a limitation of the codec that cannot be easily fixed.
|
||||||
|
r = 0;
|
||||||
|
}
|
||||||
RTC_CHECK_GE(r, 0) << "Encode failed (error code "
|
RTC_CHECK_GE(r, 0) << "Encode failed (error code "
|
||||||
<< T::GetErrorCode(isac_state_) << ")";
|
<< T::GetErrorCode(isac_state_) << ")";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user