fix: 删除广播会话失败问题

This commit is contained in:
ydajiang
2025-09-24 20:08:06 +08:00
parent ae154dfb0a
commit 9e2477ea31
2 changed files with 2 additions and 1 deletions

View File

@@ -40,7 +40,7 @@ func (d *Device) StartBroadcast(streamId common.StreamID, deviceId, channelId st
sink := &dao.SinkModel{
SinkStreamID: sinkStreamId,
StreamID: streamId,
Protocol: SourceTypeGBTalk,
Protocol: TransStreamGBTalk,
CreateTime: time.Now().Unix(),
SetupType: common.SetupTypePassive,
}

View File

@@ -29,6 +29,7 @@ func (s *Sink) Close(bye, ms bool) {
// 目前只有一对一对讲, 断开就删除整个websocket对讲流
if s.Protocol == TransStreamGBTalk {
_, _ = dao.Sink.DeleteSinkBySinkStreamID(s.SinkStreamID)
_, _ = dao.Stream.DeleteStream(s.StreamID)
// 删除流媒体source
_ = MSCloseSource(string(s.StreamID))