History

dict: Change return type of av_dict_copy()

av_dict_set() could return an error, so forward it appropriately.

Vittorio Giovara committed 11 years ago

Commit 11c5f431 parent c1aac394 files · +16 −5Browse files

Unified · Split

4 files
  1. doc/APIchanges +4 −0
  2. libavutil/dict.c +8 −3
  3. libavutil/dict.h +3 −1
  4. libavutil/version.h +1 −1
doc/APIchanges+4−0
@@ -13,6 +13,10 @@ libavutil: 2015-08-28 · 12 unmodified lines
13 13
14API changes, most recent first:14API changes, most recent first:
15 15
162015-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
162015-xx-xx - xxxxxxx - lavc 57.0.0 - avcodec.h202015-xx-xx - xxxxxxx - lavc 57.0.0 - avcodec.h
17 Change type of AVPacket.duration from int to int64_t.21 Change type of AVPacket.duration from int to int64_t.
18 22
libavutil/dict.c+8−3
@@ -186,10 +186,15 @@ void av_dict_free(AVDictionary **pm) · 185 unmodified lines
186 av_freep(pm);186 av_freep(pm);
187}187}
188 188
189void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)189int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
190{190{
191 AVDictionaryEntry *t = NULL;191 AVDictionaryEntry *t = NULL;
192 192
193 while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX)))193 while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) {
194 av_dict_set(dst, t->key, t->value, flags);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}
libavutil/dict.h+3−1
@@ -130,8 +130,10 @@ int av_dict_parse_string(AVDictionary **pm, const char *str, · 129 unmodified lines
130 * @param src pointer to source AVDictionary struct130 * @param src pointer to source AVDictionary struct
131 * @param flags flags to use when setting entries in *dst131 * @param flags flags to use when setting entries in *dst
132 * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag132 * @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 */
134void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);136int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
135 137
136/**138/**
137 * Free all the memory allocated for an AVDictionary struct139 * Free all the memory allocated for an AVDictionary struct
libavutil/version.h+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
54 */54 */
55 55
56#define LIBAVUTIL_VERSION_MAJOR 5556#define LIBAVUTIL_VERSION_MAJOR 55
57#define LIBAVUTIL_VERSION_MINOR 157#define LIBAVUTIL_VERSION_MINOR 2
58#define LIBAVUTIL_VERSION_MICRO 058#define LIBAVUTIL_VERSION_MICRO 0
59 59
60#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \60#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t