revid: fixed quantization and bitrate logic in config.Validate()

This commit is contained in:
Saxon 2019-02-25 15:56:51 +10:30
parent cc4d683ba6
commit be6e168774
1 changed files with 1 additions and 3 deletions

View File

@ -148,11 +148,9 @@ func (c *Config) Validate(r *Revid) error {
// Configuration really needs to be rethought here. // Configuration really needs to be rethought here.
if c.Quantize && c.Quantization == 0 { if c.Quantize && c.Quantization == 0 {
c.Quantization = defaultQuantization c.Quantization = defaultQuantization
} else {
c.Bitrate = defaultBitrate
} }
if (c.Bitrate > 0 && c.Quantization > 0) || (c.Bitrate == 0 && c.Quantization == 0) { if (c.Bitrate > 0 && c.Quantize) || (c.Bitrate == 0 && !c.Quantize) {
return errors.New("bad bitrate and quantization combination for H264 input") return errors.New("bad bitrate and quantization combination for H264 input")
} }