mirror of
https://github.com/lkmio/lkm.git
synced 2025-10-05 15:16:49 +08:00
修复rtmp推流结束后不释放内存问题
This commit is contained in:
@@ -61,7 +61,7 @@ func (s *Session) OnPlay(app, stream_ string, response chan utils.HookState) {
|
||||
streamName, values := stream.ParseUrl(stream_)
|
||||
|
||||
sourceId := s.generateSourceId(app, streamName)
|
||||
sink := NewSink(stream.GenerateSinkId(s.conn.RemoteAddr()), sourceId, s.conn)
|
||||
sink := NewSink(stream.GenerateSinkId(s.conn.RemoteAddr()), sourceId, s.conn, s.stack)
|
||||
sink.SetUrlValues(values)
|
||||
|
||||
log.Sugar.Infof("rtmp onplay app:%s stream:%s sink:%v conn:%s", app, stream_, sink.Id(), s.conn.RemoteAddr().String())
|
||||
@@ -109,7 +109,7 @@ func (s *Session) Close() {
|
||||
s.receiveBuffer = nil
|
||||
}
|
||||
} else {
|
||||
sink := s.handle.(stream.Sink)
|
||||
sink := s.handle.(*Sink)
|
||||
log.Sugar.Infof("rtmp拉流结束 %s", sink.PrintInfo())
|
||||
sink.Close()
|
||||
}
|
||||
|
Reference in New Issue
Block a user