From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 60DE644805 for ; Sat, 26 Nov 2022 14:47:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CA17F68BB67; Sat, 26 Nov 2022 16:47:10 +0200 (EET) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F228368BA7C for ; Sat, 26 Nov 2022 16:47:06 +0200 (EET) Received: by mail-ed1-f45.google.com with SMTP id z63so9903074ede.1 for ; Sat, 26 Nov 2022 06:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0T3GmCt5crLf07hImSNUBki7vfPbvgucLcdCCzkuCM8=; b=JBUXEgEe0VFm9w6JH0xUl0T9YtMtHHlRy/rpVFY04Kgimyp7R7O4d1/l6sccW9Tyfe VpUgSvSCyCfqIjYZ9ZXj2I7PddTXre/REULdnmW1mcfFfS0nTiCmIcOQqsNHvLxsZClN XCtcyX0VLsB0o0AbUALIl7SFMTfHJph1b/xAubX2HpfXKvou+QWLCoaS0+ODRyQCNnw6 PCqaCOfk8QjlVUbYE3FpWUp1EQbhHVRC2KPUwSTyFHYnzyYNBAt0iRM8EETjM4WciGcr f880nGPhloo1gVdEHkE9c1BUI4LbeIzEMU4w7tRsOQbcpgrhASJWsSpnCpecVXhrAYXn zUww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0T3GmCt5crLf07hImSNUBki7vfPbvgucLcdCCzkuCM8=; b=MKI2DrGuRCF3uqhESaJbi/tvyPvWigwWMjSd/2JbHyUNyyXuLm8bfOOeuTkxsn9/t1 ED2R/OJk+eM+f1kVo8C3uNt3gWV2fQbtHshrY3HBjBRoGVye0IpHf+MrrUDI1TSyBKAK 1cIQnyIm1vqyxyfPETruy3QsdKhEUHDl3gOiEt2SFREXq9VjSMRVBB5AlhquxcBumwac 7b06ee/ofvyp08wLAp97kJAC5lJ9FDtfrSrklEJTLgL1inzSxhgGazQM2DhLnfnP8qK7 tCHQZsyapLmHxpmmCulgDbJFSmCYXEQ+PJlpAYBnzi9vunLF6whScNFFDZKsq86JT6vO PI+g== X-Gm-Message-State: ANoB5pmpnerctemoChknBUKdYrdshWEZzto8w9zVWXO4KqXg7jIZBudw fX00mECAmqxua04Jcpmf7Cw/iieWjWg= X-Google-Smtp-Source: AA0mqf7lqxh5EY3iWHujG25GpKxyCPxRp92LbxasDsyQCyPuXw7H4BR1ZsEZSD/rSEh61Q4AOQYmJg== X-Received: by 2002:aa7:dbd9:0:b0:461:e8c4:d21f with SMTP id v25-20020aa7dbd9000000b00461e8c4d21fmr8386319edt.186.1669474026425; Sat, 26 Nov 2022 06:47:06 -0800 (PST) Received: from MBP-von-Marvin.citadel.scalie.me (84-112-104-25.cable.dynamic.surfer.at. [84.112.104.25]) by smtp.gmail.com with ESMTPSA id ay10-20020a056402202a00b00461cdda400esm3107745edb.4.2022.11.26.06.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 06:47:06 -0800 (PST) From: Marvin Scholz To: ffmpeg-devel@ffmpeg.org Date: Sat, 26 Nov 2022 15:46:29 +0100 Message-Id: <20221126144648.73162-13-epirat07@gmail.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20221126144648.73162-1-epirat07@gmail.com> References: <20221125013046.40904-1-epirat07@gmail.com> <20221126144648.73162-1-epirat07@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 12/31] avformat/vorbiscomment: use av_dict_iterate X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marvin Scholz Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- libavformat/vorbiscomment.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavformat/vorbiscomment.c b/libavformat/vorbiscomment.c index 13ee065a44..abe12fd586 100644 --- a/libavformat/vorbiscomment.c +++ b/libavformat/vorbiscomment.c @@ -45,17 +45,17 @@ int64_t ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string len += strlen(vendor_string); if (chapters && nb_chapters) { for (int i = 0; i < nb_chapters; i++) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; len += 4 + 12 + 1 + 10; - while ((tag = av_dict_get(chapters[i]->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(chapters[i]->metadata, tag))) { int64_t len1 = !strcmp(tag->key, "title") ? 4 : strlen(tag->key); len += 4 + 10 + len1 + 1 + strlen(tag->value); } } } if (m) { - AVDictionaryEntry *tag = NULL; - while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { + const AVDictionaryEntry *tag = NULL; + while ((tag = av_dict_iterate(m, tag))) { len += 4 +strlen(tag->key) + 1 + strlen(tag->value); } } @@ -77,9 +77,9 @@ int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, } if (m) { int count = av_dict_count(m) + cm_count; - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; avio_wl32(pb, count); - while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(m, tag))) { int64_t len1 = strlen(tag->key); int64_t len2 = strlen(tag->value); if (len1+1+len2 > UINT32_MAX) @@ -109,7 +109,7 @@ int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, avio_write(pb, chapter_time, 12); tag = NULL; - while ((tag = av_dict_get(chapters[i]->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { + while ((tag = av_dict_iterate(chapters[i]->metadata, tag))) { int64_t len1 = !strcmp(tag->key, "title") ? 4 : strlen(tag->key); int64_t len2 = strlen(tag->value); if (len1+1+len2+10 > UINT32_MAX) -- 2.37.0 (Apple Git-136) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".