diff options
author | John Stebbins <[email protected]> | 2016-02-20 18:00:46 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-03-09 13:10:10 -0700 |
commit | a44ccb49f182d4eeb122fbe675b28deb5c36b793 (patch) | |
tree | 6cc064cc24dacc2a80d41fb9543640c9004895af /libhb/hb_json.c | |
parent | 96c02dd6f256f4a4e74f8962f56502d28e5e65a3 (diff) |
filters: make job filter settings an hb_dict_t
This simplifies accessing and changing filter parameters
programatically. It also changes the custom filter string format to a
':' separated list of key/value pairs.
Diffstat (limited to 'libhb/hb_json.c')
-rw-r--r-- | libhb/hb_json.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libhb/hb_json.c b/libhb/hb_json.c index ba889244a..39f7392f3 100644 --- a/libhb/hb_json.c +++ b/libhb/hb_json.c @@ -608,7 +608,7 @@ hb_dict_t* hb_job_to_dict( const hb_job_t * job ) if (filter->settings != NULL) { hb_dict_set(filter_dict, "Settings", - hb_value_string(filter->settings)); + hb_value_dup(filter->settings)); } hb_value_array_append(filter_list, filter_dict); @@ -1070,10 +1070,10 @@ hb_job_t* hb_dict_to_job( hb_handle_t * h, hb_dict_t *dict ) { filter_dict = hb_value_array_get(filter_list, ii); int filter_id = -1; - char *filter_settings = NULL; - result = json_unpack_ex(filter_dict, &error, 0, "{s:i, s?s}", + hb_value_t *filter_settings = NULL; + result = json_unpack_ex(filter_dict, &error, 0, "{s:i, s?o}", "ID", unpack_i(&filter_id), - "Settings", unpack_s(&filter_settings)); + "Settings", unpack_o(&filter_settings)); if (result < 0) { hb_error("hb_dict_to_job: failed to find filter settings: %s", @@ -1084,7 +1084,7 @@ hb_job_t* hb_dict_to_job( hb_handle_t * h, hb_dict_t *dict ) { hb_filter_object_t *filter; filter = hb_filter_init(filter_id); - hb_add_filter(job, filter, filter_settings); + hb_add_filter_dict(job, filter, filter_settings); } } } @@ -1696,4 +1696,3 @@ hb_image_t* hb_json_to_image(char *json_image) return image; } - |