From 88de4792d0555567d877998e4fc71b4ec44a3d0d Mon Sep 17 00:00:00 2001 From: Karl Wiberg Date: Tue, 28 Apr 2015 14:58:43 +0200 Subject: [PATCH] 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} --- .../audio_coding/codecs/isac/audio_encoder_isac_t_impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h b/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h index c5982f5be6..65c5b90300 100644 --- a/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h +++ b/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h @@ -145,8 +145,9 @@ AudioEncoder::EncodedInfo AudioEncoderDecoderIsacT::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.