print 'ready' only when a source is really ready

This commit is contained in:
aler9 2021-08-18 15:42:41 +02:00
parent a2ff0d455f
commit 60823aa2b6
2 changed files with 4 additions and 4 deletions

View File

@ -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 {
return err
}
s.log(logger.Info, "ready")
defer func() {
s.parent.OnSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{Source: s})
}()

View File

@ -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 {
return true
}
s.log(logger.Info, "ready")
defer func() {
s.parent.OnSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{Source: s})
}()