summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodec.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-03-09 15:05:47 +0000
committerjstebbins <[email protected]>2015-03-09 15:05:47 +0000
commit9e9e47cd1913a34bd248a3ac5a8da9765e638bdc (patch)
tree8350a5991ef036fe05d6d7903dfd0603a3a05f78 /libhb/encavcodec.c
parent44eb2602873819fcb35cc92ea53a8f14e5bc7c64 (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/encavcodec.c')
-rw-r--r--libhb/encavcodec.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c
index fe479a393..7b1c01ccc 100644
--- a/libhb/encavcodec.c
+++ b/libhb/encavcodec.c
@@ -170,11 +170,18 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
}
/* iterate through lavc_opts and have avutil parse the options for us */
AVDictionary * av_opts = NULL;
- hb_dict_entry_t * entry = NULL;
- while( ( entry = hb_dict_next( lavc_opts, entry ) ) )
+ hb_dict_iter_t iter;
+ for (iter = hb_dict_iter_init(lavc_opts);
+ iter != HB_DICT_ITER_DONE;
+ iter = hb_dict_iter_next(lavc_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 avutil for parsing. */
- av_dict_set( &av_opts, entry->key, entry->value, 0 );
+ av_dict_set( &av_opts, key, str, 0 );
+ free(str);
}
hb_dict_free( &lavc_opts );