mirror of
https://github.com/lkmio/gb-cms.git
synced 2025-09-26 19:51:22 +08:00
fix: 提前释放stream发生crash问题
This commit is contained in:
1
main.go
1
main.go
@@ -126,7 +126,6 @@ func recoverStreams() ([]*Stream, []*Sink) {
|
||||
if !ok {
|
||||
Sugar.Infof("删除过期的推流会话 stream: %s", stream.ID)
|
||||
closedStreams = append(closedStreams, stream)
|
||||
stream.Close(true, false)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@@ -187,3 +187,10 @@ func CreateRequestFromDialog(dialog sip.Request, method sip.RequestMethod) sip.R
|
||||
func (s *Stream) CreateRequestFromDialog(method sip.RequestMethod) sip.Request {
|
||||
return CreateRequestFromDialog(s.Dialog, method)
|
||||
}
|
||||
|
||||
func CloseStream(streamId StreamID, ms bool) {
|
||||
stream := StreamManager.Remove(streamId)
|
||||
if stream != nil {
|
||||
stream.Close(true, ms)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user