fix: publish lost not shutdown

This commit is contained in:
langhuihui
2024-10-09 09:06:55 +08:00
parent 26dfd0b5cb
commit a0cca4d152

View File

@@ -492,16 +492,10 @@ func (s *Stream) run() {
s.Warn("no tracks") s.Warn("no tracks")
if time.Since(s.StartTime) > timeout { if time.Since(s.StartTime) > timeout {
lost = true lost = true
s.action(ACTION_CLOSE)
continue
} }
} else if s.Publisher != nil && s.Publisher.IsClosed() { } else if s.Publisher != nil && s.Publisher.IsClosed() {
s.Warn("publish is closed", zap.Error(context.Cause(s.publisher)), zap.String("ptr", fmt.Sprintf("%p", s.publisher.Context))) s.Warn("publish is closed", zap.Error(context.Cause(s.publisher)), zap.String("ptr", fmt.Sprintf("%p", s.publisher.Context)))
lost = true lost = true
if len(s.Tracks.Audio)+len(s.Tracks.Video) == 0 {
s.action(ACTION_CLOSE)
continue
}
} }
} }
if lost { if lost {