diff options
author | jstebbins <[email protected]> | 2015-05-28 20:29:01 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-05-28 20:29:01 +0000 |
commit | 04dbdddcb1a1d2a8231cee75ac51feae9727833d (patch) | |
tree | 94e6e9002566807730265ff969e62ee68cda0a83 /libhb/common.c | |
parent | f0109cb4cecd63949e65f7cafda9f47d81916759 (diff) |
libhb: fix issues with video options
Fixes: https://forum.handbrake.fr/viewtopic.php?f=10&t=32535&sid=321e6d1092fd09c8d380e13e86d1a9ee
- Sanitize empty video encoder settings strings to NULL.
- In the CLI, use encoder defaults if user changes the preset's video
encoder.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7237 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c index 1c8ac0925..5f22fd1b0 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -3304,6 +3304,10 @@ void hb_job_set_encoder_preset(hb_job_t *job, const char *preset) { if (job != NULL) { + if (preset == NULL || preset[0] == 0) + { + preset = NULL; + } hb_update_str(&job->encoder_preset, preset); } } @@ -3312,6 +3316,10 @@ void hb_job_set_encoder_tune(hb_job_t *job, const char *tune) { if (job != NULL) { + if (tune == NULL || tune[0] == 0) + { + tune = NULL; + } hb_update_str(&job->encoder_tune, tune); } } @@ -3320,6 +3328,10 @@ void hb_job_set_encoder_options(hb_job_t *job, const char *options) { if (job != NULL) { + if (options == NULL || options[0] == 0) + { + options = NULL; + } hb_update_str(&job->encoder_options, options); } } @@ -3328,6 +3340,10 @@ void hb_job_set_encoder_profile(hb_job_t *job, const char *profile) { if (job != NULL) { + if (profile == NULL || profile[0] == 0) + { + profile = NULL; + } hb_update_str(&job->encoder_profile, profile); } } @@ -3336,6 +3352,10 @@ void hb_job_set_encoder_level(hb_job_t *job, const char *level) { if (job != NULL) { + if (level == NULL || level[0] == 0) + { + level = NULL; + } hb_update_str(&job->encoder_level, level); } } |