Adds stop with empty producer warning

This commit is contained in:
Alexey Khit
2022-08-22 11:33:38 +03:00
parent 401bf85a10
commit 31e24c6e03
+6 -2
View File
@@ -74,8 +74,12 @@ func (p *Producer) start() {
func (p *Producer) stop() { func (p *Producer) stop() {
log.Debug().Str("url", p.url).Msg("[streams] stop producer") log.Debug().Str("url", p.url).Msg("[streams] stop producer")
_ = p.element.Stop() if p.element != nil {
p.element = nil _ = p.element.Stop()
p.element = nil
} else {
log.Warn().Str("url", p.url).Msg("[streams] stop empty producer")
}
p.tracks = nil p.tracks = nil
p.state = stateNone p.state = stateNone
} }