AudioEncoderIsac: Print error code if CHECK for successful encoding fails

This will hopefully make the crash in bug 4577 easier to understand if
it happens again.

BUG=4577
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/52389004

Cr-Commit-Position: refs/heads/master@{#9100}
This commit is contained in:
Karl Wiberg
2015-04-28 14:58:43 +02:00
parent bcbcd84888
commit 88de4792d0

View File

@ -145,8 +145,9 @@ AudioEncoder::EncodedInfo AudioEncoderDecoderIsacT<T>::EncodeInternal(
{
CriticalSectionScoped cs(state_lock_.get());
r = T::Encode(isac_state_, audio, encoded);
CHECK_GE(r, 0) << "Encode failed (error code "
<< T::GetErrorCode(isac_state_) << ")";
}
CHECK_GE(r, 0);
// T::Encode doesn't allow us to tell it the size of the output
// buffer. All we can do is check for an overrun after the fact.