Browse Source

print 'ready' only when a source is really ready

pull/523/head
aler9 4 years ago
parent
commit
60823aa2b6
  1. 4
      internal/core/rtmp_source.go
  2. 4
      internal/core/rtsp_source.go

4
internal/core/rtmp_source.go

@ -156,8 +156,6 @@ func (s *rtmpSource) runInner() bool { @@ -156,8 +156,6 @@ func (s *rtmpSource) runInner() bool {
tracks = append(tracks, audioTrack)
}
s.log(logger.Info, "ready")
res := s.parent.OnSourceStaticSetReady(pathSourceStaticSetReadyReq{
Source: s,
Tracks: tracks,
@ -166,6 +164,8 @@ func (s *rtmpSource) runInner() bool { @@ -166,6 +164,8 @@ func (s *rtmpSource) runInner() bool {
return err
}
s.log(logger.Info, "ready")
defer func() {
s.parent.OnSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{Source: s})
}()

4
internal/core/rtsp_source.go

@ -175,8 +175,6 @@ func (s *rtspSource) runInner() bool { @@ -175,8 +175,6 @@ func (s *rtspSource) runInner() bool {
return true
}
s.log(logger.Info, "ready")
res := s.parent.OnSourceStaticSetReady(pathSourceStaticSetReadyReq{
Source: s,
Tracks: conn.Tracks(),
@ -186,6 +184,8 @@ func (s *rtspSource) runInner() bool { @@ -186,6 +184,8 @@ func (s *rtspSource) runInner() bool {
return true
}
s.log(logger.Info, "ready")
defer func() {
s.parent.OnSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{Source: s})
}()

Loading…
Cancel
Save