From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id E2CAC4C269 for <ffmpegdev@gitmailbox.com>; Wed, 2 Apr 2025 18:31:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B6E1068A866; Wed, 2 Apr 2025 21:30:06 +0300 (EEST) Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BDE2068A51F for <ffmpeg-devel@ffmpeg.org>; Wed, 2 Apr 2025 21:29:58 +0300 (EEST) Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5fc6cd89f85so51653eaf.1 for <ffmpeg-devel@ffmpeg.org>; Wed, 02 Apr 2025 11:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743618597; x=1744223397; darn=ffmpeg.org; 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=BnUIpGK0NYOqMsAhXf9MxzFmAg16pXSG3UoiHXDfv3A=; b=cQG9PiWJln8AjLmyoByxjWEWm+w1zN52Hg4t/R7hKHmKXOW2n5vpISNsL7KZ6vzHqw qge0qgFvugqYg6qEB9u6IKLNkFIrAwb9/vAhyh91350ecB/J0nitwdp7VEHObqrJk9Ep X+0O4ckwK0VYdLyOu4tdwLQxhXQNQDhC3OuUDEvFQ29cX5FKpsJqnQ8L7c5yQNv+zufI BeEwXFkjjdiOdNj0eTG8N6kuRdJqhQiL5oIzJTI+vc3LG8KhCukO4yHPPNliItXhaFR/ PDEDIlKpHurTmNT81ye02BAbI+zahlbNIR1LRRUclpLIaWTn4yd4C+eczQfvfdjtBQY2 fm/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743618597; x=1744223397; 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=BnUIpGK0NYOqMsAhXf9MxzFmAg16pXSG3UoiHXDfv3A=; b=urDRZI/3o5tWd0uq30rdWXDkYRFnSvGg97oXBb+cMgYAy2LCeU5q95cMzay+1h3rGD nx7NrsdLb8Ozbp3GTw08JlL/dx8CwWA3dp3xN80CGmW5zOcWnj1ZwassYjtaWPPZ9QHo PMuXZT7v/krO1YfLl4mcLnsEyXdZfEcvE4t3oJYobF54OvzV3NaEBqBUbWipaAoGNf4n jMdZ2G+faSRSMPJKWU2N/ziWsFp2JRsCXewSKGNSFohw8gGoVDB7HE8UrsihJUfsZmoB VJqMuSxUbif5eyI//7G8hmyYsWpiO+l3OxMZpG2DjengizRvTHS8hs0sE3zA7Jah15LT fSAg== X-Gm-Message-State: AOJu0YwU/w0EDfw+A/7xvKCa3JV9ylkBEE9cw1oNCz1arstZiFmD38f/ SrCPJT93GrKorf6MoM4sE0FtnHh2+1+WPh6Ci0nNNkgTpXWVkgBrYQyQcltq X-Gm-Gg: ASbGncvNbRMuxFtMBof91KT3VrOGqiSn57uKX7TC/CqJSzzoMwUbeC753V3vP75QEBj YaliRkpDMmhsJoN4ik+/o/agDnbHbsLG3ohAiwh9bKZulmGZj+nry8b5/yZOhowfvBFRyW085e/ kyqXeuhBBB1Q4vgAZpnUKZRqk2iav5S1wR7so7EwWD5rKMGFlzKtXYst0LeCyHtS4IyNglpz3eT HUJkbj3rnUsG2bnGh+mrFPSzcAU41wmbbqBMrKJraxQ3ic7UuFGQQjTWHng3jDoCk+AU9eRbqNc lC1D7n+h8S7qP9NWsHfSgiEb37y60KgkPc9Hoa26y1VfG9NEIo+j9DvpzMdseeGVZnCdUYTQSGo SE+aTaKqhSH3J X-Google-Smtp-Source: AGHT+IFryyLFhIrH+uwjJ7SIDatKRxtt9SaK4HkWHxzn8RlaR1KT+QpVMON/MPsPDqKdH5Y4y0D+Wg== X-Received: by 2002:a05:6870:d3c3:b0:2b8:306f:c5ad with SMTP id 586e51a60fabf-2cbcf4e1f31mr10826117fac.13.1743618597076; Wed, 02 Apr 2025 11:29:57 -0700 (PDT) Received: from mac.lan (ip72-211-125-114.no.no.cox.net. [72.211.125.114]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-72c58267f54sm2349862a34.55.2025.04.02.11.29.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 02 Apr 2025 11:29:56 -0700 (PDT) From: Romain Beauxis <romain.beauxis@gmail.com> To: ffmpeg-devel@ffmpeg.org Date: Wed, 2 Apr 2025 13:29:39 -0500 Message-Id: <20250402182940.29726-8-romain.beauxis@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250402182940.29726-1-romain.beauxis@gmail.com> References: <20250402182940.29726-1-romain.beauxis@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v10 7/8] libavformat/oggparseopus.c: Parse comments from secondary chained streams header packet. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Romain Beauxis <romain.beauxis@gmail.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250402182940.29726-8-romain.beauxis@gmail.com/> List-Archive: <https://master.gitmailbox.com/ffmpegdev/> List-Post: <mailto:ffmpegdev@gitmailbox.com> --- libavformat/oggparseopus.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c index 218e9df581..fe25ad44f3 100644 --- a/libavformat/oggparseopus.c +++ b/libavformat/oggparseopus.c @@ -29,6 +29,7 @@ struct oggopus_private { int need_comments; + int comments_parsed; unsigned pre_skip; int64_t cur_dts; }; @@ -81,7 +82,17 @@ static int opus_header(AVFormatContext *avf, int idx) if (priv->need_comments) { if (os->psize < 8 || memcmp(packet, "OpusTags", 8)) return AVERROR_INVALIDDATA; - ff_vorbis_stream_comment(avf, st, packet + 8, os->psize - 8); + + if (!priv->comments_parsed) { + ff_vorbis_stream_comment(avf, st, packet + 8, os->psize - 8); + priv->comments_parsed = 1; + } else { + ret = ff_vorbis_update_metadata(avf, st, packet + 8, os->psize - 8); + + if (ret < 0) + return ret; + } + priv->need_comments--; return 1; } -- 2.39.5 (Apple Git-154) _______________________________________________ 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".