PacketBuffer no longer copy the bitstream data of incoming packets.
This change the interface of the PacketBuffer since the bitstream data of the packet has to be persistent when inserted into the PacketBuffer. BUG=webrtc:5514 R=stefan@webrtc.org Review URL: https://codereview.webrtc.org/2476283002 . Cr-Commit-Position: refs/heads/master@{#14949}
This commit is contained in:
@ -100,16 +100,6 @@ bool PacketBuffer::InsertPacket(const VCMPacket& packet) {
|
||||
sequence_buffer_[index].used = true;
|
||||
data_buffer_[index] = packet;
|
||||
|
||||
// Since the data pointed to by |packet.dataPtr| is non-persistent the
|
||||
// data has to be copied to its own buffer.
|
||||
// TODO(philipel): Take ownership instead of copying payload when
|
||||
// bitstream-fixing has been implemented.
|
||||
if (packet.sizeBytes) {
|
||||
uint8_t* payload = new uint8_t[packet.sizeBytes];
|
||||
memcpy(payload, packet.dataPtr, packet.sizeBytes);
|
||||
data_buffer_[index].dataPtr = payload;
|
||||
}
|
||||
|
||||
FindFrames(seq_num);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user