]> granicus.if.org Git - handbrake/commitdiff
LinGui: preset import/export robustness
authorjstebbins <jstebbins.hb@gmail.com>
Fri, 28 Dec 2012 19:39:12 +0000 (19:39 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Fri, 28 Dec 2012 19:39:12 +0000 (19:39 +0000)
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

index 2adcfdeadabbbe48bcaad8517fbb2fd1feb5665c..216015f3c9744295c1436bc1e5383abee47be5d1 100644 (file)
@@ -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)
     {