mirror of https://bitbucket.org/ausocean/av.git
revid: fixed log messages in config.go to make easier to understand
This commit is contained in:
parent
1a2fa72e58
commit
8f56a82053
|
@ -145,11 +145,11 @@ func (c *Config) Validate(r *Revid) error {
|
|||
if c.Bitrate != "" && c.Quantization != "" {
|
||||
bitrate, err := strconv.Atoi(c.Bitrate)
|
||||
if err != nil {
|
||||
return errors.New("something is wrong with bitrate in config")
|
||||
return errors.New("bitrate not an integer")
|
||||
}
|
||||
quantization, err := strconv.Atoi(c.Quantization)
|
||||
if err != nil {
|
||||
return errors.New("something is wrong with quantization in config")
|
||||
return errors.New("quantization not an integer")
|
||||
}
|
||||
if (bitrate > 0 && quantization > 0) || (bitrate == 0 && quantization == 0) {
|
||||
return errors.New("bad bitrate and quantization combination for H264 input")
|
||||
|
@ -159,7 +159,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
if c.Quantization != "" {
|
||||
quantization, err := strconv.Atoi(c.Quantization)
|
||||
if err != nil {
|
||||
return errors.New("something is wrong with quantization in config")
|
||||
return errors.New("quantization not an integer")
|
||||
}
|
||||
if quantization > 0 || c.Bitrate == "" {
|
||||
return errors.New("bad bitrate or quantization for mjpeg input")
|
||||
|
@ -246,7 +246,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
c.Width = defaultWidth
|
||||
} else {
|
||||
if integer, err := strconv.Atoi(c.Width); integer < 0 || err != nil {
|
||||
return errors.New("bad width defined in config")
|
||||
return errors.New("width not unsigned integer")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
c.Height = defaultHeight
|
||||
} else {
|
||||
if integer, err := strconv.Atoi(c.Height); integer < 0 || err != nil {
|
||||
return errors.New("bad height defined in config")
|
||||
return errors.New("height not unsigned integer")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,7 +266,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
c.FrameRate = defaultFrameRate
|
||||
} else {
|
||||
if integer, err := strconv.Atoi(c.FrameRate); integer < 0 || err != nil {
|
||||
return errors.New("bad frame rate defined in config")
|
||||
return errors.New("frame rate not unsigned integer")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
c.Bitrate = defaultBitrate
|
||||
} else {
|
||||
if integer, err := strconv.Atoi(c.Bitrate); integer < 0 || err != nil {
|
||||
return errors.New("bad bitrate defined in config")
|
||||
return errors.New("bitrate not unsigned integer")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
c.Timeout = defaultTimeout
|
||||
} else {
|
||||
if integer, err := strconv.Atoi(c.Timeout); integer < 0 || err != nil {
|
||||
return errors.New("bad timeout defined in config")
|
||||
return errors.New("timeout not unsigned integer")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
c.IntraRefreshPeriod = defaultIntraRefreshPeriod
|
||||
} else {
|
||||
if integer, err := strconv.Atoi(c.IntraRefreshPeriod); integer < 0 || err != nil {
|
||||
return errors.New("bad intra refresh defined in config")
|
||||
return errors.New("intra refresh not unsigned integer")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
c.Quantization = defaultQuantization
|
||||
} else {
|
||||
if integer, err := strconv.Atoi(c.Quantization); integer < 0 || integer > 51 || err != nil {
|
||||
return errors.New("bad quantization defined in config")
|
||||
return errors.New("quantisation not unsigned integer or is over threshold")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue