diff options
author | Tim Walker <[email protected]> | 2016-04-03 22:36:25 +0200 |
---|---|---|
committer | Tim Walker <[email protected]> | 2016-04-03 22:36:25 +0200 |
commit | 18821cd07b6faf2007adb556d82f82df9f0dc8bf (patch) | |
tree | 029931cfccb80f2a0b36c5a2be6793529816e1d3 | |
parent | 7a268dcebb31604fe35d1d40ff1cb91b70498eff (diff) |
json: fix sanitization of vquality
…for encoders that check for a valid bitrate before quality.
-rw-r--r-- | libhb/hb_json.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libhb/hb_json.c b/libhb/hb_json.c index 8e4bd6020..82d3762e9 100644 --- a/libhb/hb_json.c +++ b/libhb/hb_json.c @@ -993,18 +993,22 @@ hb_job_t* hb_dict_to_job( hb_handle_t * h, hb_dict_t *dict ) hb_job_set_encoder_level(job, video_level); hb_job_set_encoder_options(job, video_options); - // If both vbitrate and vquality were specified, vbitrate is used + // If both vbitrate and vquality were specified, vbitrate is used; + // we need to ensure the unused rate contro mode is always set to an + // invalid value, as if both values aere valid, behavior is undefined + // (some encoders first check for a valid vquality, whereas others + // check for a valid vbitrate instead) if (vbitrate > 0) { job->vbitrate = vbitrate; job->vquality = HB_INVALID_VIDEO_QUALITY; } - else if (vquality != HB_INVALID_VIDEO_QUALITY) + else if (vquality > HB_INVALID_VIDEO_QUALITY) { + job->vbitrate = -1; job->vquality = vquality; } - // If neither vbitrate or vquality were specified, defaults are used - // defaults are set in job_setup() + // If neither were specified, defaults are used (set in job_setup()) job->select_subtitle_config.dest = subtitle_search_burn ? RENDERSUB : PASSTHRUSUB; |