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
This commit is contained in:
jmarusic@webrtc.org 2015-02-24 09:56:58 +00:00
parent e3fccd4268
commit 13ca5f6db2

View File

@ -188,9 +188,8 @@ bool AudioEncoderOpus::EncodeInternal(uint32_t rtp_timestamp,
rtc::CheckedDivExact(CastInt16(input_buffer_.size()),
static_cast<int16_t>(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_;