修复rtmp推拉流内存泄漏问题

This commit is contained in:
yangjiechina
2024-06-28 20:56:18 +08:00
parent 8d886d1444
commit ece14dbc27
18 changed files with 127 additions and 102 deletions

View File

@@ -158,7 +158,7 @@ func (t *transStream) WriteHeader() error {
if videoStream != nil {
tmp := n
n += t.muxer.WriteVideoData(t.header[n+12:], 0, false, true)
extra := videoStream.CodecParameters().DecoderConfRecord().ToMP4VC()
extra := videoStream.CodecParameters().MP4ExtraData()
copy(t.header[n+12:], extra)
n += len(extra)
@@ -179,6 +179,7 @@ func (t *transStream) Close() error {
if len(segment) > 0 {
t.SendPacket(segment)
}
return nil
}