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/enc_qsv.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/enc_qsv.c')
-rw-r--r-- | libhb/enc_qsv.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libhb/enc_qsv.c b/libhb/enc_qsv.c index 8051bd5d0..c4aca79ff 100644 --- a/libhb/enc_qsv.c +++ b/libhb/enc_qsv.c @@ -577,27 +577,32 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job) if (job->encoder_options != NULL && *job->encoder_options) { hb_dict_t *options_list; - hb_dict_entry_t *option = NULL; options_list = hb_encopts_to_dict(job->encoder_options, job->vcodec); - while ((option = hb_dict_next(options_list, option)) != NULL) + + hb_dict_iter_t iter; + for (iter = hb_dict_iter_init(x264_opts); + iter != HB_DICT_ITER_DONE; + iter = hb_dict_iter_next(x264_opts, iter)) { - switch (hb_qsv_param_parse(&pv->param, pv->qsv_info, - option->key, option->value)) + 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); + + switch (hb_qsv_param_parse(&pv->param, pv->qsv_info, key, str)) { case HB_QSV_PARAM_OK: break; case HB_QSV_PARAM_BAD_NAME: - hb_log("encqsvInit: hb_qsv_param_parse: bad key %s", - option->key); + hb_log("encqsvInit: hb_qsv_param_parse: bad key %s", key); break; case HB_QSV_PARAM_BAD_VALUE: hb_log("encqsvInit: hb_qsv_param_parse: bad value %s for key %s", - option->value, option->key); + str, key); break; case HB_QSV_PARAM_UNSUPPORTED: hb_log("encqsvInit: hb_qsv_param_parse: unsupported option %s", - option->key); + key); break; case HB_QSV_PARAM_ERROR: @@ -605,6 +610,7 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job) hb_log("encqsvInit: hb_qsv_param_parse: unknown error"); break; } + free(str); } hb_dict_free(&options_list); } |