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 /test | |
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 'test')
-rw-r--r-- | test/test.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test.c b/test/test.c index 22816c73c..408181f02 100644 --- a/test/test.c +++ b/test/test.c @@ -3231,6 +3231,26 @@ static hb_dict_t * PreparePreset(const char *preset_name) if (vcodec != NULL) { + const char *s; + int old, new; + + s = hb_value_get_string(hb_dict_get(preset, "VideoEncoder")); + old = hb_video_encoder_get_from_name(s); + new = hb_video_encoder_get_from_name(vcodec); + if (old != new) + { + // If the user explicitly changes a video encoder, remove the + // preset VideoPreset, VideoTune, VideoProfile, VideoLevel, and + // VideoOptionExtra. + // + // Use defaults for the encoder since these settings may not be + // compatible across encoders. + hb_dict_remove(preset, "VideoPreset"); + hb_dict_remove(preset, "VideoTune"); + hb_dict_remove(preset, "VideoProfile"); + hb_dict_remove(preset, "VideoLevel"); + hb_dict_remove(preset, "VideoOptionExtra"); + } hb_dict_set(preset, "VideoEncoder", hb_value_string(vcodec)); } if (encoder_preset != NULL) |