diff options
author | jstebbins <[email protected]> | 2015-03-09 15:05:47 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-03-09 15:05:47 +0000 |
commit | 9e9e47cd1913a34bd248a3ac5a8da9765e638bdc (patch) | |
tree | 8350a5991ef036fe05d6d7903dfd0603a3a05f78 /libhb/encx265.c | |
parent | 44eb2602873819fcb35cc92ea53a8f14e5bc7c64 (diff) |
libhb: use jansson for hb_dict
This paves the way to doing preset processing in libhb. Initially for the CLI
but other frontends may benefit eventually.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6981 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encx265.c')
-rw-r--r-- | libhb/encx265.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/libhb/encx265.c b/libhb/encx265.c index 324c07e5b..8743b8d20 100644 --- a/libhb/encx265.c +++ b/libhb/encx265.c @@ -184,16 +184,26 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job) } /* iterate through x265_opts and parse the options */ - hb_dict_entry_t *entry = NULL; - hb_dict_t *x265_opts = hb_encopts_to_dict(job->encoder_options, job->vcodec); - while ((entry = hb_dict_next(x265_opts, entry)) != NULL) + hb_dict_t *x265_opts; + x265_opts = hb_encopts_to_dict(job->encoder_options, job->vcodec); + + hb_dict_iter_t iter; + for (iter = hb_dict_iter_init(x265_opts); + iter != HB_DICT_ITER_DONE; + iter = hb_dict_iter_next(x265_opts, iter)) { + const char *key = hb_dict_iter_key(iter); + hb_value_t *value = hb_dict_iter_value(iter); + char *str = hb_value_get_string_xform(value); + // here's where the strings are passed to libx265 for parsing - if (param_parse(param, entry->key, entry->value)) + if (param_parse(param, key, str)) { + free(str); hb_dict_free(&x265_opts); goto fail; } + free(str); } hb_dict_free(&x265_opts); |