Browse Source

print 'ready' only when a source is really ready

pull/523/head
aler9 5 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 {
tracks = append(tracks, audioTrack) tracks = append(tracks, audioTrack)
} }
s.log(logger.Info, "ready")
res := s.parent.OnSourceStaticSetReady(pathSourceStaticSetReadyReq{ res := s.parent.OnSourceStaticSetReady(pathSourceStaticSetReadyReq{
Source: s, Source: s,
Tracks: tracks, Tracks: tracks,
@ -166,6 +164,8 @@ func (s *rtmpSource) runInner() bool {
return err return err
} }
s.log(logger.Info, "ready")
defer func() { defer func() {
s.parent.OnSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{Source: s}) s.parent.OnSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{Source: s})
}() }()

4
internal/core/rtsp_source.go

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

Loading…
Cancel
Save