First tries to intrepret file as json. If that fails, tries plist.
Returns a json string.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7314
b64f7644-9d1e-0410-96f1-
a4d463321fa5
return preset;
}
+char * hb_presets_read_file_json(const char *filename)
+{
+ char *result;
+ hb_value_t *preset = hb_value_read_json(filename);
+ if (preset == NULL)
+ preset = hb_plist_parse_file(filename);
+ if (preset == NULL)
+ return NULL;
+
+ result = hb_value_get_json(preset);
+ return result;
+}
+
int hb_presets_add_file(const char *filename)
{
hb_value_t *preset = hb_value_read_json(filename);