1
0
Fork 0
forked from External/mediamtx

fix freeze when server is shut down and runOnPublish is not empty

This commit is contained in:
aler9 2022-01-19 22:19:38 +01:00
parent 98dbf5d932
commit 8337a90b29

View file

@ -476,13 +476,7 @@ func (pa *path) run() {
req.res <- pathReaderSetupPlayRes{err: fmt.Errorf("terminated")}
}
for rp := range pa.readers {
rp.close()
}
if pa.stream != nil {
pa.stream.close()
}
pa.sourceSetNotReady()
if pa.source != nil {
if source, ok := pa.source.(sourceStatic); ok {
@ -639,12 +633,15 @@ func (pa *path) sourceSetNotReady() {
if pa.onPublishCmd != nil {
pa.onPublishCmd.Close()
pa.onPublishCmd = nil
pa.log(logger.Info, "runOnPublish command stopped")
pa.log(logger.Info, "runOnReady command stopped")
}
pa.sourceReady = false
pa.stream.close()
pa.stream = nil
if pa.stream != nil {
pa.stream.close()
pa.stream = nil
}
}
func (pa *path) staticSourceCreate() {