av_dict_set() could return an error, so forward it appropriately.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
API changes, most recent first:
+2015-xx-xx - xxxxxxx - lavu 55.2.0 - dict.h
+ Change return type of av_dict_copy() from void to int, so that a proper
+ error code can be reported.
+
2015-xx-xx - xxxxxxx - lavc 57.0.0 - avcodec.h
Change type of AVPacket.duration from int to int64_t.
av_freep(pm);
}
-void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
+int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
{
AVDictionaryEntry *t = NULL;
- while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX)))
- av_dict_set(dst, t->key, t->value, flags);
+ while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) {
+ int ret = av_dict_set(dst, t->key, t->value, flags);
+ if (ret < 0)
+ return ret;
+ }
+
+ return 0;
}
* @param src pointer to source AVDictionary struct
* @param flags flags to use when setting entries in *dst
* @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+ * @return 0 on success, negative AVERROR code on failure. If dst was allocated
+ * by this function, callers should free the associated memory.
*/
-void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
+int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
/**
* Free all the memory allocated for an AVDictionary struct
*/
#define LIBAVUTIL_VERSION_MAJOR 55
-#define LIBAVUTIL_VERSION_MINOR 1
+#define LIBAVUTIL_VERSION_MINOR 2
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \