mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #202, fix memory leak of h.264 raw packet send in srs-librtmp. 2.0.20.
This commit is contained in:
parent
7ebca6cb5b
commit
bb5e99f562
3 changed files with 5 additions and 1 deletions
|
@ -1075,6 +1075,7 @@ char* srs_amf0_human_print(srs_amf0_t amf0, char** pdata, int* psize)
|
|||
* write h264 packet, with rtmp header.
|
||||
* @param frame_type, SrsCodecVideoAVCFrameKeyFrame or SrsCodecVideoAVCFrameInterFrame.
|
||||
* @param avc_packet_type, SrsCodecVideoAVCTypeSequenceHeader or SrsCodecVideoAVCTypeNALU.
|
||||
* @param h264_raw_data the h.264 raw data, user must free it.
|
||||
*/
|
||||
int __srs_write_h264_packet(Context* context,
|
||||
int8_t frame_type, int8_t avc_packet_type,
|
||||
|
@ -1142,6 +1143,7 @@ int __srs_write_h264_sps_pps(Context* context, u_int32_t dts, u_int32_t pts)
|
|||
+ 3 + (int)context->h264_sps.length()
|
||||
+ 3 + (int)context->h264_pps.length();
|
||||
char* packet = new char[nb_packet];
|
||||
SrsAutoFree(char, packet);
|
||||
|
||||
// use stream to generate the h264 packet.
|
||||
SrsStream stream;
|
||||
|
@ -1236,6 +1238,7 @@ int __srs_write_h264_ipb_frame(Context* context,
|
|||
// NALUnit
|
||||
int nb_packet = 4 + size;
|
||||
char* packet = new char[nb_packet];
|
||||
SrsAutoFree(char, packet);
|
||||
|
||||
// use stream to generate the h264 packet.
|
||||
SrsStream stream;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue