This allows getting rid of the many, slightly differing, implementations of basically the same thing.
Unified · Split
| @@ -15,6 +15,9 @@ libavutil: 2014-08-09 · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | API changes, most recent first: | 16 | API changes, most recent first: |
| 17 | 17 | ||
| 18 | 2014-xx-xx - xxxxxxx - lavu 54.4.100 - dict.h | ||
| 19 | Add av_dict_set_int helper function. | ||
| 20 | |||
| 18 | 2014-08-xx - xxxxxxx - lavu 54.03.0 - mem.h | 21 | 2014-08-xx - xxxxxxx - lavu 54.03.0 - mem.h |
| 19 | Add av_strndup(). | 22 | Add av_strndup(). |
| 20 | 23 | ||
| @@ -122,6 +122,14 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, · 121 unmodified lines | |||
| 122 | return 0; | 122 | return 0; |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, | ||
| 126 | int flags) | ||
| 127 | { | ||
| 128 | char valuestr[22]; | ||
| 129 | snprintf(valuestr, sizeof(valuestr), "%"PRId64, value); | ||
| 130 | return av_dict_set(pm, key, valuestr, flags); | ||
| 131 | } | ||
| 132 | |||
| 125 | static int parse_key_value_pair(AVDictionary **pm, const char **buf, | 133 | static int parse_key_value_pair(AVDictionary **pm, const char **buf, |
| 126 | const char *key_val_sep, const char *pairs_sep, | 134 | const char *key_val_sep, const char *pairs_sep, |
| 127 | int flags) | 135 | int flags) |
| @@ -31,6 +31,8 @@ · 30 unmodified lines | |||
| 31 | #ifndef AVUTIL_DICT_H | 31 | #ifndef AVUTIL_DICT_H |
| 32 | #define AVUTIL_DICT_H | 32 | #define AVUTIL_DICT_H |
| 33 | 33 | ||
| 34 | #include <stdint.h> | ||
| 35 | |||
| 34 | #include "version.h" | 36 | #include "version.h" |
| 35 | 37 | ||
| 36 | /** | 38 | /** |
| @@ -122,6 +124,12 @@ int av_dict_count(const AVDictionary *m); · 85 unmodified lines | |||
| 122 | */ | 124 | */ |
| 123 | int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags); | 125 | int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags); |
| 124 | 126 | ||
| 127 | /** | ||
| 128 | * Convenience wrapper for av_dict_set that converts the value to a string | ||
| 129 | * and stores it. | ||
| 130 | */ | ||
| 131 | int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags); | ||
| 132 | |||
| 125 | /** | 133 | /** |
| 126 | * Parse the key/value pairs list and add the parsed entries to a dictionary. | 134 | * Parse the key/value pairs list and add the parsed entries to a dictionary. |
| 127 | * | 135 | * |
| @@ -56,7 +56,7 @@ · 55 unmodified lines | |||
| 56 | */ | 56 | */ |
| 57 | 57 | ||
| 58 | #define LIBAVUTIL_VERSION_MAJOR 54 | 58 | #define LIBAVUTIL_VERSION_MAJOR 54 |
| 59 | #define LIBAVUTIL_VERSION_MINOR 3 | 59 | #define LIBAVUTIL_VERSION_MINOR 4 |
| 60 | #define LIBAVUTIL_VERSION_MICRO 100 | 60 | #define LIBAVUTIL_VERSION_MICRO 100 |
| 61 | 61 | ||
| 62 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 62 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |