fixed framesPerClip Validation

This commit is contained in:
Saxon1 2018-04-19 18:52:09 +09:30
parent 1437b54450
commit 7201f52ac1
1 changed files with 5 additions and 5 deletions

View File

@ -199,12 +199,12 @@ func (config *Config) Validate(r *revid) error {
return errors.New("Bad packetization option defined in config!") return errors.New("Bad packetization option defined in config!")
} }
if fpcAsInt, err := strconv.Atoi(config.FramesPerClip); fpcAsInt > 0 || err != nil { if config.FramesPerClip == "" {
return errors.New("Bad frames per clip in config!") r.Log(Warning, "No FramesPerClip defined defined, defaulting to 1!")
config.Width = defaultFramesPerClip
} else { } else {
if fpcAsInt == 0 { if integer, err := strconv.Atoi(config.FramesPerClip); integer <= 0 || err != nil {
r.Log(Warning, "No frames per clip defined, defaulting to 1!") return errors.New("Bad width defined in config!")
config.FramesPerClip = defaultFramesPerClip
} }
} }