From a27835f8854129a45b8e9f3c28614966848ff9dd Mon Sep 17 00:00:00 2001 From: jstebbins Date: Fri, 28 Dec 2012 19:39:12 +0000 Subject: LinGui: preset import/export robustness Upon import, if x264Preset is missing, force x264UseAdvancedOptions enabled. Upon export, if x264UseAdvancedOptions is true, do not output x264Preset, x264Tune, x264Level, x264Profile, or x264OptionExtra. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5114 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/presets.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gtk/src/presets.c') diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 2adcfdead..216015f3c 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -2866,6 +2866,8 @@ import_xlat_preset(GValue *dict) ghb_int_value_new(ii)); } } + ghb_dict_insert(dict, g_strdup("x264UseAdvancedOptions"), + ghb_boolean_value_new(TRUE)); } const char *x264Tune = dict_get_string(dict, "x264Tune"); @@ -3002,6 +3004,14 @@ export_xlat_preset(GValue *dict) } } + if (ghb_value_boolean(preset_dict_get_value(dict, "x264UseAdvancedOptions"))) + { + ghb_dict_remove(dict, "x264Preset"); + ghb_dict_remove(dict, "x264Tune"); + ghb_dict_remove(dict, "h264Profile"); + ghb_dict_remove(dict, "h264Level"); + ghb_dict_remove(dict, "x264OptionExtra"); + } const char *tune = dict_get_string(dict, "x264Tune"); if (tune != NULL) { -- cgit v1.2.3