History

Merge commit '11c5f438ff83da5040e85bfa6299f56b321d32ef'

* commit '11c5f438ff83da5040e85bfa6299f56b321d32ef': dict: Change return type of av_dict_copy()

Hendrik Leppkes committed 11 years ago

Commit b9947882 parents fcfb66b 11c5f434 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
@@ -15,6 +15,10 @@ libavutil: 2015-08-28 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
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+
1822 2015-09-29 - xxxxxxx - lavc 57.3.100 / lavc 57.2.0 - avcodec.h
1923 Change type of AVPacket.duration from int to int64_t.
2024
libavutil/dict.c+8−3
@@ -210,12 +210,17 @@ void av_dict_free(AVDictionary **pm) · 209 unmodified lines
210210 av_freep(pm);
211211 }
212212
213−void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
213+int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
214214 {
215215 AVDictionaryEntry *t = NULL;
216216
217− while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX)))
218− av_dict_set(dst, t->key, t->value, flags);
217+ while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) {
218+ int ret = av_dict_set(dst, t->key, t->value, flags);
219+ if (ret < 0)
220+ return ret;
221+ }
222+
223+ return 0;
219224 }
220225
221226 int av_dict_get_string(const AVDictionary *m, char **buffer,
libavutil/dict.h+3−1
@@ -162,8 +162,10 @@ int av_dict_parse_string(AVDictionary **pm, const char *str, · 161 unmodified lines
162162 * @param src pointer to source AVDictionary struct
163163 * @param flags flags to use when setting entries in *dst
164164 * @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.
165167 */
166−void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
168+int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags);
167169
168170 /**
169171 * Free all the memory allocated for an AVDictionary struct
libavutil/version.h+1−1
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 */
5757
5858 #define LIBAVUTIL_VERSION_MAJOR 55
59−#define LIBAVUTIL_VERSION_MINOR 3
59+#define LIBAVUTIL_VERSION_MINOR 4
6060 #define LIBAVUTIL_VERSION_MICRO 100
6161
6262 #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