diff mbox series

[FFmpeg-devel,23/31] avformat/wtvenc: use av_dict_iterate

Message ID 20221125013046.40904-24-epirat07@gmail.com
State New
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/wtvenc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Andreas Rheinhardt Nov. 25, 2022, 12:53 p.m. UTC | #1
Marvin Scholz:
> ---
>  libavformat/wtvenc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
> index 7e28b2082e..977e16c5a4 100644
> --- a/libavformat/wtvenc.c
> +++ b/libavformat/wtvenc.c
> @@ -670,12 +670,12 @@ static void write_table_entries_attrib(AVFormatContext *s)
>  {
>      WtvContext *wctx = s->priv_data;
>      AVIOContext *pb = s->pb;
> -    AVDictionaryEntry *tag = 0;
> +    const AVDictionaryEntry *tag = 0;
>  
>      ff_standardize_creation_time(s);
>      //FIXME: translate special tags (e.g. WM/Bitrate) to binary representation
>      ff_metadata_conv(&s->metadata, ff_asf_metadata_conv, NULL);
> -    while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
> +    while ((tag = av_dict_iterate(s->metadata, tag)))
>          write_tag(pb, tag->key, tag->value);
>  
>      if (wctx->thumbnail.size) {
> @@ -698,11 +698,11 @@ static void write_table_redirector_legacy_attrib(AVFormatContext *s)
>  {
>      WtvContext *wctx = s->priv_data;
>      AVIOContext *pb = s->pb;
> -    AVDictionaryEntry *tag = 0;
> +    const AVDictionaryEntry *tag = 0;
>      int64_t pos = 0;
>  
>      //FIXME: translate special tags to binary representation
> -    while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
> +    while ((tag = av_dict_iterate(s->metadata, tag))) {
>          avio_wl64(pb, pos);
>          pos += metadata_header_size(tag->key) + strlen(tag->value)*2 + 2;
>      }

We typically use NULL for NULL pointers.

- Andreas
diff mbox series

Patch

diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index 7e28b2082e..977e16c5a4 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -670,12 +670,12 @@  static void write_table_entries_attrib(AVFormatContext *s)
 {
     WtvContext *wctx = s->priv_data;
     AVIOContext *pb = s->pb;
-    AVDictionaryEntry *tag = 0;
+    const AVDictionaryEntry *tag = 0;
 
     ff_standardize_creation_time(s);
     //FIXME: translate special tags (e.g. WM/Bitrate) to binary representation
     ff_metadata_conv(&s->metadata, ff_asf_metadata_conv, NULL);
-    while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
+    while ((tag = av_dict_iterate(s->metadata, tag)))
         write_tag(pb, tag->key, tag->value);
 
     if (wctx->thumbnail.size) {
@@ -698,11 +698,11 @@  static void write_table_redirector_legacy_attrib(AVFormatContext *s)
 {
     WtvContext *wctx = s->priv_data;
     AVIOContext *pb = s->pb;
-    AVDictionaryEntry *tag = 0;
+    const AVDictionaryEntry *tag = 0;
     int64_t pos = 0;
 
     //FIXME: translate special tags to binary representation
-    while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
+    while ((tag = av_dict_iterate(s->metadata, tag))) {
         avio_wl64(pb, pos);
         pos += metadata_header_size(tag->key) + strlen(tag->value)*2 + 2;
     }