av_dict_set() could return an error, so forward it appropriately.
Unified · Split
| @@ -13,6 +13,10 @@ libavutil: 2015-08-28 · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | API changes, most recent first: |
| 15 | 15 | |
| 16 | +2015-xx-xx - xxxxxxx - lavu 55.2.0 - dict.h | |
| 17 | + Change return type of av_dict_copy() from void to int, so that a proper | |
| 18 | + error code can be reported. | |
| 19 | + | |
| 16 | 20 | 2015-xx-xx - xxxxxxx - lavc 57.0.0 - avcodec.h |
| 17 | 21 | Change type of AVPacket.duration from int to int64_t. |
| 18 | 22 | |
| @@ -186,10 +186,15 @@ void av_dict_free(AVDictionary **pm) · 185 unmodified lines | ||
| 186 | 186 | av_freep(pm); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | −void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags) | |
| 189 | +int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags) | |
| 190 | 190 | { |
| 191 | 191 | AVDictionaryEntry *t = NULL; |
| 192 | 192 | |
| 193 | − while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) | |
| 194 | − av_dict_set(dst, t->key, t->value, flags); | |
| 193 | + while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) { | |
| 194 | + int ret = av_dict_set(dst, t->key, t->value, flags); | |
| 195 | + if (ret < 0) | |
| 196 | + return ret; | |
| 197 | + } | |
| 198 | + | |
| 199 | + return 0; | |
| 195 | 200 | } |
| @@ -130,8 +130,10 @@ int av_dict_parse_string(AVDictionary **pm, const char *str, · 129 unmodified lines | ||
| 130 | 130 | * @param src pointer to source AVDictionary struct |
| 131 | 131 | * @param flags flags to use when setting entries in *dst |
| 132 | 132 | * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag |
| 133 | + * @return 0 on success, negative AVERROR code on failure. If dst was allocated | |
| 134 | + * by this function, callers should free the associated memory. | |
| 133 | 135 | */ |
| 134 | −void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags); | |
| 136 | +int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags); | |
| 135 | 137 | |
| 136 | 138 | /** |
| 137 | 139 | * Free all the memory allocated for an AVDictionary struct |
| @@ -54,7 +54,7 @@ · 53 unmodified lines | ||
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | 56 | #define LIBAVUTIL_VERSION_MAJOR 55 |
| 57 | −#define LIBAVUTIL_VERSION_MINOR 1 | |
| 57 | +#define LIBAVUTIL_VERSION_MINOR 2 | |
| 58 | 58 | #define LIBAVUTIL_VERSION_MICRO 0 |
| 59 | 59 | |
| 60 | 60 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |