Convert any presets with "Type" official to custom before importing.
This can happen if someone decides to try to import a full user presets
file from a previous install of HandBrake.
return PRESET_DO_NEXT;
}
+static int do_make_custom(hb_value_t *preset, preset_do_context_t *ctx)
+{
+ hb_dict_set_int(preset, "Type", HB_PRESET_TYPE_CUSTOM);
+ return PRESET_DO_NEXT;
+}
+
static int do_delete_builtin(hb_value_t *preset, preset_do_context_t *ctx)
{
if (hb_value_get_int(hb_dict_get(preset, "Type")) == HB_PRESET_TYPE_OFFICIAL)
if (preset == NULL)
return -1;
+ preset_do_context_t ctx;
+
+ ctx.path.depth = 1;
+ presets_do(do_make_custom, preset, &ctx);
+
int result = hb_presets_add(preset);
hb_value_free(&preset);