mirror of https://bitbucket.org/ausocean/av.git
fixed framesPerClip Validation
This commit is contained in:
parent
1437b54450
commit
7201f52ac1
|
@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue