Take control over your live stream video by running it yourself. Streaming + chat out of the box.
HTML activitypubbroadcastingchatdecentralizedfederationfediversegolanghacktoberfesthlslivelivestreamowncastrtmpself-hostedstreaming-videovideo
fix(stream): preserve safe empty status handling
Gabe Kangasa19b1131d15f
diff --git a/services/stream/status.go b/services/stream/status.goindex b042c8b433..93ce009441 100644--- a/services/stream/status.go+++ b/services/stream/status.go@@ -8,16 +8,20 @@ import (// GetStatus returns a snapshot of the current stream state suitable for// the public/admin status APIs.func (s *Service) GetStatus() models.Status {+ s.statsMu.RLock()+ if s.stats == nil {+ s.statsMu.RUnlock()+ return models.Status{}+ }+ s.statsMu.RUnlock()+waitTime := float64(s.configRepository.GetStreamLatencyLevel().SecondsPerSegment) * 3.0if waitTime < 7 {waitTime = 7}s.statsMu.RLock()- if s.stats == nil {- s.statsMu.RUnlock()- return models.Status{}- }+ defer s.statsMu.RUnlock()online := s.isStreamConnectedLocked(waitTime)viewerCount := 0@@ -32,10 +36,8 @@ func (s *Service) GetStatus() models.Status {LastDisconnectTime: s.stats.LastDisconnectTime,LastConnectTime: s.stats.LastConnectTime,VersionNumber: config.VersionNumber,+ StreamTitle: s.configRepository.GetStreamTitle(),}- s.statsMu.RUnlock()-- status.StreamTitle = s.configRepository.GetStreamTitle()return status}