diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2014-07-31 20:08:19 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2014-08-16 14:30:18 +0200 |
commit | c2829dc925ffcc2a5934f3e99360a89fb0a3cad5 (patch) | |
tree | 67a20dfc78ed71ef6a54bbababaae6aa364a99b2 /libavutil/dict.c | |
parent | 82e0cb360aaa87a62f731ee3dee500e98bf9d1a6 (diff) | |
download | ffmpeg-c2829dc925ffcc2a5934f3e99360a89fb0a3cad5.tar.gz |
dict.c: Add av_dict_set_int helper function.
This allows getting rid of the many, slightly differing, implementations
of basically the same thing.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavutil/dict.c')
-rw-r--r-- | libavutil/dict.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/dict.c b/libavutil/dict.c index aea8910541..9fdc6d6273 100644 --- a/libavutil/dict.c +++ b/libavutil/dict.c @@ -122,6 +122,14 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, return 0; } +int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, + int flags) +{ + char valuestr[22]; + snprintf(valuestr, sizeof(valuestr), "%"PRId64, value); + return av_dict_set(pm, key, valuestr, flags); +} + static int parse_key_value_pair(AVDictionary **pm, const char **buf, const char *key_val_sep, const char *pairs_sep, int flags) |