Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: webrtc/video/payload_router.cc

Issue 2512543002: Fix PayloadRouter::OnEncodedImage() to handle errors properly. (Closed)
Patch Set: fix tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/video/payload_router_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/payload_router.cc
diff --git a/webrtc/video/payload_router.cc b/webrtc/video/payload_router.cc
index 2cc3e887b59e1da3254adf04b826574153ee23d7..33d8f76e86055a3b3e1ad484d1d3b87e4b7e4a99 100644
--- a/webrtc/video/payload_router.cc
+++ b/webrtc/video/payload_router.cc
@@ -127,24 +127,21 @@ EncodedImageCallback::Result PayloadRouter::OnEncodedImage(
if (!active_)
return Result(Result::ERROR_SEND_FAILED);
- int stream_index = 0;
-
RTPVideoHeader rtp_video_header;
memset(&rtp_video_header, 0, sizeof(RTPVideoHeader));
if (codec_specific_info)
CopyCodecSpecific(codec_specific_info, &rtp_video_header);
rtp_video_header.rotation = encoded_image.rotation_;
rtp_video_header.playout_delay = encoded_image.playout_delay_;
- stream_index = rtp_video_header.simulcastIdx;
+ int stream_index = rtp_video_header.simulcastIdx;
+ RTC_DCHECK_LT(stream_index, rtp_modules_.size());
uint32_t frame_id;
- int send_result = rtp_modules_[stream_index]->SendOutgoingData(
+ bool send_result = rtp_modules_[stream_index]->SendOutgoingData(
encoded_image._frameType, payload_type_, encoded_image._timeStamp,
encoded_image.capture_time_ms_, encoded_image._buffer,
encoded_image._length, fragmentation, &rtp_video_header, &frame_id);
-
- RTC_DCHECK_LT(rtp_video_header.simulcastIdx, rtp_modules_.size());
- if (send_result < 0)
+ if (!send_result)
return Result(Result::ERROR_SEND_FAILED);
return Result(Result::OK, frame_id);
« no previous file with comments | « no previous file | webrtc/video/payload_router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698