Chromium Code Reviews| Index: webrtc/modules/rtp_rtcp/source/rtp_packet.cc |
| diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet.cc b/webrtc/modules/rtp_rtcp/source/rtp_packet.cc |
| index 283512cd8fa51e7d7dc74da62f5cc116f9051ad3..d089560e68cf25d59b6b14a6e22a0d6369588da0 100644 |
| --- a/webrtc/modules/rtp_rtcp/source/rtp_packet.cc |
| +++ b/webrtc/modules/rtp_rtcp/source/rtp_packet.cc |
| @@ -274,6 +274,7 @@ uint8_t* Packet::AllocatePayload(size_t size_bytes) { |
| LOG(LS_WARNING) << "Cannot set payload, not enough space in buffer."; |
| return nullptr; |
| } |
| + buffer_.SetSize(payload_offset_); // Reset payload size to avoid copying it. |
|
sprang_webrtc
2016/09/27 10:45:00
I'm not sure I follow this. How does doing this Se
danilchap
2016/09/27 11:47:05
comment expanded.
this optimization was added to R
|
| payload_size_ = size_bytes; |
| buffer_.SetSize(payload_offset_ + payload_size_); |
| return WriteAt(payload_offset_); |