Index: webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc |
index 22bf1079d0e453e102bcfdebf4a6cf3106e5bbde..490bfbae4a7aca2bc3698ca86afe9cc46b1cf142 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc |
@@ -362,15 +362,11 @@ bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type, |
bool last = false; |
while (!last) { |
std::unique_ptr<RtpPacketToSend> packet(new RtpPacketToSend(*rtp_header)); |
- uint8_t* payload = packet->AllocatePayload(max_data_payload_length); |
- RTC_DCHECK(payload); |
- size_t payload_bytes_in_packet = 0; |
- if (!packetizer->NextPacket(payload, &payload_bytes_in_packet, &last)) |
+ if (!packetizer->NextPacket(packet.get(), &last)) |
return false; |
+ RTC_DCHECK_LE(packet->payload_size(), max_data_payload_length); |
- packet->SetPayloadSize(payload_bytes_in_packet); |
- packet->SetMarker(last); |
if (!rtp_sender_->AssignSequenceNumber(packet.get())) |
return false; |