diff mbox series

[FFmpeg-devel,26/31] avformat/nutenc: use av_dict_iterate

Message ID 20221125013046.40904-27-epirat07@gmail.com
State Accepted
Headers show
Series Use av_dict_iterate where approproate | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marvin Scholz Nov. 25, 2022, 1:30 a.m. UTC
---
 libavformat/nutenc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 1afdeeb8ab..ff81ee34aa 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -516,7 +516,7 @@  static int add_info(AVIOContext *bc, const char *type, const char *value)
 static int write_globalinfo(NUTContext *nut, AVIOContext *bc)
 {
     AVFormatContext *s   = nut->avf;
-    AVDictionaryEntry *t = NULL;
+    const AVDictionaryEntry *t = NULL;
     AVIOContext *dyn_bc;
     uint8_t *dyn_buf = NULL;
     int count        = 0, dyn_size;
@@ -525,7 +525,7 @@  static int write_globalinfo(NUTContext *nut, AVIOContext *bc)
         return ret;
 
     ff_standardize_creation_time(s);
-    while ((t = av_dict_get(s->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
+    while ((t = av_dict_iterate(s->metadata, t)))
         count += add_info(dyn_bc, t->key, t->value);
 
     put_v(bc, 0); //stream_if_plus1
@@ -544,7 +544,7 @@  static int write_globalinfo(NUTContext *nut, AVIOContext *bc)
 static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id) {
     AVFormatContext *s= nut->avf;
     AVStream* st = s->streams[stream_id];
-    AVDictionaryEntry *t = NULL;
+    const AVDictionaryEntry *t = NULL;
     AVIOContext *dyn_bc;
     uint8_t *dyn_buf=NULL;
     int count=0, dyn_size, i;
@@ -552,7 +552,7 @@  static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id) {
     if (ret < 0)
         return ret;
 
-    while ((t = av_dict_get(st->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
+    while ((t = av_dict_iterate(st->metadata, t)))
         count += add_info(dyn_bc, t->key, t->value);
     for (i=0; ff_nut_dispositions[i].flag; ++i) {
         if (st->disposition & ff_nut_dispositions[i].flag)
@@ -587,7 +587,7 @@  static int write_chapter(NUTContext *nut, AVIOContext *bc, int id)
 {
     AVIOContext *dyn_bc;
     uint8_t *dyn_buf     = NULL;
-    AVDictionaryEntry *t = NULL;
+    const AVDictionaryEntry *t = NULL;
     AVChapter *ch        = nut->avf->chapters[id];
     int ret, dyn_size, count = 0;
 
@@ -600,7 +600,7 @@  static int write_chapter(NUTContext *nut, AVIOContext *bc, int id)
     put_tt(nut, nut->chapter[id].time_base, bc, ch->start); // chapter_start
     put_v(bc, ch->end - ch->start);                         // chapter_len
 
-    while ((t = av_dict_get(ch->metadata, "", t, AV_DICT_IGNORE_SUFFIX)))
+    while ((t = av_dict_iterate(ch->metadata, t)))
         count += add_info(dyn_bc, t->key, t->value);
 
     put_v(bc, count);