1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Refine comments

This commit is contained in:
winlin 2021-05-20 10:49:42 +08:00
parent d55af6be44
commit 8f304b94ec

View file

@ -823,9 +823,8 @@ char* SrsRtpPacket::wrap(char* data, int size)
char* SrsRtpPacket::wrap(SrsSharedPtrMessage* msg) char* SrsRtpPacket::wrap(SrsSharedPtrMessage* msg)
{ {
// Generally, the wrap(msg) is used for RTMP to RTC, which is not generated by RTC, // Generally, the wrap(msg) is used for RTMP to RTC, where the msg
// so we do not recycle the msg. It's ok to directly free the msg, event the msg is // is not generated by RTC.
// allocated by object cache manager.
srs_freep(shared_buffer_); srs_freep(shared_buffer_);
// Copy from the new message. // Copy from the new message.
@ -840,11 +839,6 @@ SrsRtpPacket* SrsRtpPacket::copy()
{ {
SrsRtpPacket* cp = new SrsRtpPacket(); SrsRtpPacket* cp = new SrsRtpPacket();
// We got packet from cache, the payload and message MUST be NULL,
// because we had clear it in recycle.
//srs_assert(!cp->payload_);
//srs_assert(!cp->shared_buffer_);
cp->header = header; cp->header = header;
cp->payload_ = payload_? payload_->copy():NULL; cp->payload_ = payload_? payload_->copy():NULL;
cp->payload_type_ = payload_type_; cp->payload_type_ = payload_type_;