From 13ca5f6db2db66e34907141f151dac780ae2411d Mon Sep 17 00:00:00 2001 From: "jmarusic@webrtc.org" Date: Tue, 24 Feb 2015 09:56:58 +0000 Subject: [PATCH] AudioEncoderOpus: CHECK that encode call doesn't fail WebRtcOpus_Encode will only ever fail if fed bad input, and since we don't do that, we can CHECK that it doesn't fail instead of having code that tries to handle failure. R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/40899004 Cr-Commit-Position: refs/heads/master@{#8469} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8469 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc b/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc index 4df92fd30..25256bcaa 100644 --- a/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc +++ b/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc @@ -188,9 +188,8 @@ bool AudioEncoderOpus::EncodeInternal(uint32_t rtp_timestamp, rtc::CheckedDivExact(CastInt16(input_buffer_.size()), static_cast(num_channels_)), ClampInt16(max_encoded_bytes), encoded); + CHECK_GE(r, 0); // Fails only if fed invalid data. input_buffer_.clear(); - if (r < 0) - return false; info->encoded_bytes = r; info->encoded_timestamp = first_timestamp_in_buffer_; info->payload_type = payload_type_;