diff --git a/internal/core/path.go b/internal/core/path.go index 118f23ee..4fcbd469 100644 --- a/internal/core/path.go +++ b/internal/core/path.go @@ -351,6 +351,7 @@ func (pa *path) doOnDemandPublisherCloseTimer() { func (pa *path) doReloadConf(newConf *conf.Path) { pa.confMutex.Lock() + oldConf := pa.conf pa.conf = newConf pa.confMutex.Unlock() @@ -358,14 +359,21 @@ func (pa *path) doReloadConf(newConf *conf.Path) { pa.source.(*staticsources.Handler).ReloadConf(newConf) } - if pa.conf.Record { - if pa.stream != nil && pa.recorder == nil { - pa.startRecording() - } - } else if pa.recorder != nil { + if pa.recorder != nil && + (newConf.Record != oldConf.Record || + newConf.RecordPath != oldConf.RecordPath || + newConf.RecordFormat != oldConf.RecordFormat || + newConf.RecordPartDuration != oldConf.RecordPartDuration || + newConf.RecordMaxPartSize != oldConf.RecordMaxPartSize || + newConf.RecordSegmentDuration != oldConf.RecordSegmentDuration || + newConf.RecordDeleteAfter != oldConf.RecordDeleteAfter) { pa.recorder.Close() pa.recorder = nil } + + if newConf.Record && pa.stream != nil && pa.recorder == nil { + pa.startRecording() + } } func (pa *path) doSourceStaticSetReady(req defs.PathSourceStaticSetReadyReq) { diff --git a/internal/core/path_manager.go b/internal/core/path_manager.go index a76fa8e5..13ae9255 100644 --- a/internal/core/path_manager.go +++ b/internal/core/path_manager.go @@ -23,6 +23,12 @@ func pathConfCanBeUpdated(oldPathConf *conf.Path, newPathConf *conf.Path) bool { clone.Regexp = newPathConf.Regexp clone.Record = newPathConf.Record + clone.RecordPath = newPathConf.RecordPath + clone.RecordFormat = newPathConf.RecordFormat + clone.RecordPartDuration = newPathConf.RecordPartDuration + clone.RecordMaxPartSize = newPathConf.RecordMaxPartSize + clone.RecordSegmentDuration = newPathConf.RecordSegmentDuration + clone.RecordDeleteAfter = newPathConf.RecordDeleteAfter clone.RPICameraBrightness = newPathConf.RPICameraBrightness clone.RPICameraContrast = newPathConf.RPICameraContrast