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

Unified Diff: webrtc/modules/rtp_rtcp/source/flexfec_receiver.cc

Issue 2506373004: RtpPacket::payload() return rtc::ArrayView instead of raw pointer (Closed)
Patch Set: 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
Index: webrtc/modules/rtp_rtcp/source/flexfec_receiver.cc
diff --git a/webrtc/modules/rtp_rtcp/source/flexfec_receiver.cc b/webrtc/modules/rtp_rtcp/source/flexfec_receiver.cc
index c84da552087cfe958b362c0137f63f48d49596a3..2c974754915cad4a28188b823bb9f1f949e96d95 100644
--- a/webrtc/modules/rtp_rtcp/source/flexfec_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/flexfec_receiver.cc
@@ -97,9 +97,9 @@ bool FlexfecReceiver::AddReceivedPacket(const uint8_t* packet,
// TODO(brandtr): Remove this memcpy when the FEC packet classes
// are using COW buffers internally.
received_packet->pkt = rtc::scoped_refptr<Packet>(new Packet());
- memcpy(received_packet->pkt->data, parsed_packet.payload(),
- parsed_packet.payload_size());
- received_packet->pkt->length = parsed_packet.payload_size();
+ auto payload = parsed_packet.payload();
+ memcpy(received_packet->pkt->data, payload.data(), payload.size());
+ received_packet->pkt->length = payload.size();
} else {
// This is a media packet, or a FlexFEC packet belonging to some
// other FlexFEC stream.
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_packet.h » ('j') | webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698