diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-05-17 17:04:50 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-05-20 13:52:41 +0200 |
commit | f3d206d25ffdb02ba30b9bf37720f94819f9be3e (patch) | |
tree | 94a87e39d2a69f8574b5ef918698da044b085167 /libavformat | |
parent | 482afe8f3f7b9ea17521371c53e9d783be95020a (diff) | |
download | ffmpeg-f3d206d25ffdb02ba30b9bf37720f94819f9be3e.tar.gz |
fftools, avfilter, avformat: Simplify check for "is dictionary empty?"
Reviewed-by: epirat07@gmail.com
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/aacdec.c | 2 | ||||
-rw-r--r-- | libavformat/http.c | 8 | ||||
-rw-r--r-- | libavformat/mpc.c | 2 | ||||
-rw-r--r-- | libavformat/oggenc.c | 2 | ||||
-rw-r--r-- | libavformat/wvdec.c | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index d5324df4d5..0b4bd69dd2 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -119,7 +119,7 @@ static int adts_aac_read_header(AVFormatContext *s) ff_id3v1_read(s); if ((s->pb->seekable & AVIO_SEEKABLE_NORMAL) && - !av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX)) { + !av_dict_count(s->metadata)) { int64_t cur = avio_tell(s->pb); ff_ape_parse_tag(s); avio_seek(s->pb, cur, SEEK_SET); diff --git a/libavformat/http.c b/libavformat/http.c index 1a67068a44..ec60bc0b17 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -990,7 +990,7 @@ static int parse_set_cookie(const char *set_cookie, AVDictionary **dict) static int parse_cookie(HTTPContext *s, const char *p, AVDictionary **cookies) { AVDictionary *new_params = NULL; - AVDictionaryEntry *e, *cookie_entry; + const AVDictionaryEntry *e, *cookie_entry; char *eql, *name; // ensure the cookie is parsable @@ -998,7 +998,7 @@ static int parse_cookie(HTTPContext *s, const char *p, AVDictionary **cookies) return -1; // if there is no cookie value there is nothing to parse - cookie_entry = av_dict_get(new_params, "", NULL, AV_DICT_IGNORE_SUFFIX); + cookie_entry = av_dict_iterate(new_params, NULL); if (!cookie_entry || !cookie_entry->value) { av_dict_free(&new_params); return -1; @@ -1300,7 +1300,7 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path, *cookies = NULL; while ((cookie = av_strtok(next, "\n", &saveptr)) && !ret) { AVDictionary *cookie_params = NULL; - AVDictionaryEntry *cookie_entry, *e; + const AVDictionaryEntry *cookie_entry, *e; next = NULL; // store the cookie in a dict in case it is updated in the response @@ -1312,7 +1312,7 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path, goto skip_cookie; // if the cookie has no value, skip it - cookie_entry = av_dict_get(cookie_params, "", NULL, AV_DICT_IGNORE_SUFFIX); + cookie_entry = av_dict_iterate(cookie_params, NULL); if (!cookie_entry || !cookie_entry->value) goto skip_cookie; diff --git a/libavformat/mpc.c b/libavformat/mpc.c index 60cb768ab6..1e0e170c7d 100644 --- a/libavformat/mpc.c +++ b/libavformat/mpc.c @@ -112,7 +112,7 @@ static int mpc_read_header(AVFormatContext *s) if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) { int64_t pos = avio_tell(s->pb); ff_ape_parse_tag(s); - if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX)) + if (av_dict_count(s->metadata) == 0) ff_id3v1_read(s); avio_seek(s->pb, pos, SEEK_SET); } diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index f5782cb583..224519a4da 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -432,7 +432,7 @@ static int ogg_build_vp8_headers(AVFormatContext *s, AVStream *st, bytestream_put_be32(&p, st->time_base.num); /* optional second packet: VorbisComment */ - if (av_dict_get(st->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX)) { + if (av_dict_count(st->metadata)) { p = ogg_write_vorbiscomment(7, bitexact, &oggstream->header_len[1], &st->metadata, 0, NULL, 0); if (!p) return AVERROR(ENOMEM); diff --git a/libavformat/wvdec.c b/libavformat/wvdec.c index b25c1eee83..e2a79957f7 100644 --- a/libavformat/wvdec.c +++ b/libavformat/wvdec.c @@ -268,7 +268,7 @@ static int wv_read_header(AVFormatContext *s) if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) { int64_t cur = avio_tell(s->pb); wc->apetag_start = ff_ape_parse_tag(s); - if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX)) + if (av_dict_count(s->metadata) == 0) ff_id3v1_read(s); avio_seek(s->pb, cur, SEEK_SET); } |