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 DCF4544DDF for ; Fri, 25 Nov 2022 01:32:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A34268BBE7; Fri, 25 Nov 2022 03:31:09 +0200 (EET) Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5192068BAF5 for ; Fri, 25 Nov 2022 03:31:01 +0200 (EET) Received: by mail-ej1-f43.google.com with SMTP id i10so7248393ejg.6 for ; Thu, 24 Nov 2022 17:31:01 -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=DM783YuyWRkCzTxZWZEMHzIMB6hCfaLpxei0lGBFsjgt8CwCPjqaTBONS1PnHTfsLW mhs+e/JIm00re6v7bkrYbuUxRCzZnbGvWYqmDGAd6NcmoNPzWiFQgQWQPfSaiEOSlx9+ IlU3kRj2f4LXyowPyiEkkQiNKCYlT5egHEYwPtL7cyFpSoPqdJKHQiVTTjB/mtdLZi1u 52ZpbmCzR0N1c4YaxrIcV8n4ymSDuKI8ansTAgPEVtDw3n1RgX9svKliPo8swpZa44hP Aoq2iA/AHDD4EIJ6v6/89KLJEj5lJ+B9u1Bch7kA1Oa9Qzh+xO3P/9sH/hO6at2RpZ3b vN8g== 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=C865iOhL3AUk5vvo4NoXWXAKp1sEYc16A2JuRDNulTrHnzZyvTrqE9obcVPotpdsxj yUuRM+FngejRFL/LwOvaMlad4gmHlJaTO7cePG5KhR6KbMXSQs8qPLUuPMVhMz7Li5SO BEYU87DyuYKFahJsPcBKk/He9+WRiFCJ6ZvSkFxyh/EuUqkb1mwPM1Do7KlrqtCLrYcI Ey+3DgVVnStsPP67e45e5O3i/lS4foVpKuxOoT8zG0AlKzCXgv0dM60RtCSOc6CGbk6j PToHal6R6uPkw2hO1JWZZU7r1I7fyTCQeEX4azb3/YI1Cx+XbPRGEV67sgJaPaY78vWp kPHQ== X-Gm-Message-State: ANoB5pmllm7OkH8Sj0wKeulVQsAbJvLixKRerhXNQ+MIGAB2bdoNg6Y5 /wzNN5K/eQcWMtaaewUgQ4LDB8DJjsM= X-Google-Smtp-Source: AA0mqf6FC+Q5LOePW7j6O1f7qCRaa+1l5hb16Ur08agkhtWYpvz2j7Ei8BtqGb8mfn8NnaNV1O+2ww== X-Received: by 2002:a17:907:774e:b0:7ae:39b4:7208 with SMTP id kx14-20020a170907774e00b007ae39b47208mr13852927ejc.766.1669339860689; Thu, 24 Nov 2022 17:31:00 -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 jo9-20020a170906f6c900b0078b1ff41f05sm1011498ejb.43.2022.11.24.17.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 17:31:00 -0800 (PST) From: Marvin Scholz To: ffmpeg-devel@ffmpeg.org Date: Fri, 25 Nov 2022 02:30:27 +0100 Message-Id: <20221125013046.40904-13-epirat07@gmail.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20221125013046.40904-1-epirat07@gmail.com> References: <20221125013046.40904-1-epirat07@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 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".