mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-09-26 19:51:26 +08:00
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user