From patchwork Fri Nov 25 01:30:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Scholz X-Patchwork-Id: 39433 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp4949870pzb; Thu, 24 Nov 2022 17:34:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf5nmVX7pZ5Z1tz6bGNfRxMrZmpgjQd8KiCkptE6VLZbK/UbR2mXgn7naqxfLW30CT679HV1 X-Received: by 2002:a05:6402:1717:b0:461:8fbf:f607 with SMTP id y23-20020a056402171700b004618fbff607mr31945290edu.235.1669340073471; Thu, 24 Nov 2022 17:34:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669340073; cv=none; d=google.com; s=arc-20160816; b=tEVzRZnBggE6tIo6WWU4Fn8DH4rA7gqwvQpKgrAUtzd7Q2tbIJrbuGSFWrTXTBsXgj hQt57Z7VRnoJZnEazQp1DkUXaPgVW86cmLDQwOk3u7NOsycbAQwssokGJm8k937E/3FL 06G3N7Mmpb4s/v8sjQVNWCetuNQEjQVK+/J3byRcrYc/4gIz3Hzvriy2zo3Rp+thLtZ4 N+UwjFoNIqGFqwdtDtDg2MSoMnnyeoO4ybqfdO4bbiQlNStv5+cZINdOIBlG04jtEWQ1 zXg7zpoMS+2dUY31fz2OCnvQatxnWy9aLkeFP6PicUN+eZNDHYL/oF31y/98v+fobXwq t9dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=8P/eu7JJz3HY7AWQSLGFcTGy2VmsE5eMUA5VTXpKq5k=; b=TCanc2Ai4r5Om6zUKAC35A1g/7lw6I616oi0H8QqH3ehQtAZRecpVXbuORVLuO9pet PGX5ZJHaQokir/2lMv6L2XjvtpGR18uxdsNX1JaVxuva1lcoHNZczZAJiuDTcafI3ACp Pzw6CBTxUi+9H8CaCUezJvOaUl6q74yrqpDh+9XxbeDb24fg+59fEI/CWWH22v/5sBsI Zkpd+6f/nL7nj+4T1fk7Cc0tzvCsTJMkD0SuLLDBsJQXhzBDW2E/fYFPzVIhks61/emb ZLzbsyrPh+1IW287e9CRbbiB0DeIaG9SX6QiZl9ap71KfOEwogoiwp4PacjUtDrbaUcj /Ozw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=J0k9RFYK; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hg2-20020a1709072cc200b00780837381d8si2120233ejc.591.2022.11.24.17.34.33; Thu, 24 Nov 2022 17:34:33 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=J0k9RFYK; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 458F668BC91; Fri, 25 Nov 2022 03:31:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0861068BB3A for ; Fri, 25 Nov 2022 03:31:11 +0200 (EET) Received: by mail-ej1-f47.google.com with SMTP id f18so7274391ejz.5 for ; Thu, 24 Nov 2022 17:31:11 -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=usF8IYSm4A8E4G8ZBIFm+bYtC1XpOWWOV+xjiBQExXg=; b=J0k9RFYKgvCUKvNX8n6/zI0IOHwDXnmysbxOEtWmSvD59EocdKx46JbIYYX28oxF6a Qujga45GqLecW6zrMBX9EZIMPbt5PoVuQq7I3hXP6b+fiv7J8JwNLpSYgBWv/jKX3D34 0QiL53o7i35+64I+snPnFBnzxU09IK8Wjik8P5Hv0PmdDe8lYQnOdIlCeBkxwPo/UFUm HhpSvptPIT+gqgy3JMwXntAyjAKDDXxTXhXG4ULVUraJIhCd7oTz2/8Y6g6SWe8H+qLm U3mYr0GUa67xak0JmnyEqvN8jfHIoQaUn/gcHusRH0sMOf7xMBoaF/px2pAiiQTUhpVI yo1Q== 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=usF8IYSm4A8E4G8ZBIFm+bYtC1XpOWWOV+xjiBQExXg=; b=Cut2++TN4DG0mhzaHUOWA6R+c7XcG2mIn9I1/FuQSwm5DJfAY/WCyWn6n1e2yQ6p04 fe42MBh5o+7ooIAOfqn53sEYiIlmbDqJnEhyjOti4swTqekBuvL0UXSNUq7i2z0O7uPT GdKw234ZFoP4Owp/5mG99xv4LRQ4gGIOs04zA1HeV3XmaCZLda1rctw/okfx8k9hAZrD Tt672ojhmsbJGY9Ic/bl9cBkWvhuv/2Apc7ETgiUjrvGJf2Zn90jCDnN+/LbDV/leJ5W o87XMW2YKv/WrGeydP+u2q9VN0ixp0O3/n4HmcpZJib3nH006/KMkuPrac3rLOSvM/F+ 3OCw== X-Gm-Message-State: ANoB5pnhIoaGeREr5qMuW46grzch0BlJWviqDoWdP0eNhmJcb4xSsMc6 h0Jl2FnzuvwpQDzJ2764sd0R/jCx8ko= X-Received: by 2002:a17:906:cb90:b0:772:e95f:cdce with SMTP id mf16-20020a170906cb9000b00772e95fcdcemr30204808ejb.78.1669339871755; Thu, 24 Nov 2022 17:31:11 -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.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 17:31:11 -0800 (PST) From: Marvin Scholz To: ffmpeg-devel@ffmpeg.org Date: Fri, 25 Nov 2022 02:30:40 +0100 Message-Id: <20221125013046.40904-26-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 25/31] avformat/id3v2enc: 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0D9uzZ+2XS62 --- libavformat/id3v2enc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/id3v2enc.c b/libavformat/id3v2enc.c index 515d2efd7d..ac907c2758 100644 --- a/libavformat/id3v2enc.c +++ b/libavformat/id3v2enc.c @@ -150,7 +150,7 @@ static int id3v2_put_priv(ID3v2EncContext *id3, AVIOContext *avioc, const char * return len + ID3v2_HEADER_SIZE; } -static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, AVDictionaryEntry *t, +static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, const AVDictionaryEntry *t, const char table[][4], enum ID3v2Encoding enc) { uint32_t tag; @@ -167,13 +167,13 @@ static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, AVDictio static void id3v2_3_metadata_split_date(AVDictionary **pm) { - AVDictionaryEntry *mtag = NULL; + const AVDictionaryEntry *mtag = NULL; AVDictionary *dst = NULL; const char *key, *value; char year[5] = {0}, day_month[5] = {0}; int i; - while ((mtag = av_dict_get(*pm, "", mtag, AV_DICT_IGNORE_SUFFIX))) { + while ((mtag = av_dict_iterate(*pm, mtag))) { key = mtag->key; if (!av_strcasecmp(key, "date")) { /* split date tag using "YYYY-MM-DD" format into year and month/day segments */ @@ -220,7 +220,7 @@ void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version, static int write_metadata(AVIOContext *pb, AVDictionary **metadata, ID3v2EncContext *id3, int enc) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int ret; ff_metadata_conv(metadata, ff_id3v2_34_metadata_conv, NULL); @@ -229,7 +229,7 @@ static int write_metadata(AVIOContext *pb, AVDictionary **metadata, else if (id3->version == 4) ff_metadata_conv(metadata, ff_id3v2_4_metadata_conv, NULL); - while ((t = av_dict_get(*metadata, "", t, AV_DICT_IGNORE_SUFFIX))) { + while ((t = av_dict_iterate(*metadata, t))) { if ((ret = id3v2_check_write_tag(id3, pb, t, ff_id3v2_tags, enc)) > 0) { id3->len += ret; continue;