* commit '11c5f438ff83da5040e85bfa6299f56b321d32ef': dict: Change return type of av_dict_copy()
Unified · Split
| @@ -15,6 +15,10 @@ libavutil: 2015-08-28 · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | API changes, most recent first: | 16 | API changes, most recent first: |
| 17 | 17 | ||
| 18 | 2015-10-14 - xxxxxxx - lavu 55.4.100 / lavu 55.2.0 - dict.h | ||
| 19 | Change return type of av_dict_copy() from void to int, so that a proper | ||
| 20 | error code can be reported. | ||
| 21 | |||
| 18 | 2015-09-29 - xxxxxxx - lavc 57.3.100 / lavc 57.2.0 - avcodec.h | 22 | 2015-09-29 - xxxxxxx - lavc 57.3.100 / lavc 57.2.0 - avcodec.h |
| 19 | Change type of AVPacket.duration from int to int64_t. | 23 | Change type of AVPacket.duration from int to int64_t. |
| 20 | 24 | ||
| @@ -210,12 +210,17 @@ void av_dict_free(AVDictionary **pm) · 209 unmodified lines | |||
| 210 | av_freep(pm); | 210 | av_freep(pm); |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags) | 213 | int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags) |
| 214 | { | 214 | { |
| 215 | AVDictionaryEntry *t = NULL; | 215 | AVDictionaryEntry *t = NULL; |
| 216 | 216 | ||
| 217 | while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) | 217 | while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) { |
| 218 | av_dict_set(dst, t->key, t->value, flags); | 218 | int ret = av_dict_set(dst, t->key, t->value, flags); |
| 219 | if (ret < 0) | ||
| 220 | return ret; | ||
| 221 | } | ||
| 222 | |||
| 223 | return 0; | ||
| 219 | } | 224 | } |
| 220 | 225 | ||
| 221 | int av_dict_get_string(const AVDictionary *m, char **buffer, | 226 | int av_dict_get_string(const AVDictionary *m, char **buffer, |
| @@ -162,8 +162,10 @@ int av_dict_parse_string(AVDictionary **pm, const char *str, · 161 unmodified lines | |||
| 162 | * @param src pointer to source AVDictionary struct | 162 | * @param src pointer to source AVDictionary struct |
| 163 | * @param flags flags to use when setting entries in *dst | 163 | * @param flags flags to use when setting entries in *dst |
| 164 | * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag | 164 | * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag |
| 165 | * @return 0 on success, negative AVERROR code on failure. If dst was allocated | ||
| 166 | * by this function, callers should free the associated memory. | ||
| 165 | */ | 167 | */ |
| 166 | void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags); | 168 | int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags); |
| 167 | 169 | ||
| 168 | /** | 170 | /** |
| 169 | * Free all the memory allocated for an AVDictionary struct | 171 | * Free all the memory allocated for an AVDictionary struct |
| @@ -56,7 +56,7 @@ · 55 unmodified lines | |||
| 56 | */ | 56 | */ |
| 57 | 57 | ||
| 58 | #define LIBAVUTIL_VERSION_MAJOR 55 | 58 | #define LIBAVUTIL_VERSION_MAJOR 55 |
| 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, \ |