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 D5F7E4CFFC
	for <ffmpegdev@gitmailbox.com>; Tue, 15 Apr 2025 22:24:20 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E7F1B687D85;
	Wed, 16 Apr 2025 01:22:59 +0300 (EEST)
Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com
 [209.85.210.49])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 021D0687D85
 for <ffmpeg-devel@ffmpeg.org>; Wed, 16 Apr 2025 01:22:50 +0300 (EEST)
Received: by mail-ot1-f49.google.com with SMTP id
 46e09a7af769-72a4793d4e2so3693893a34.2
 for <ffmpeg-devel@ffmpeg.org>; Tue, 15 Apr 2025 15:22:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1744755768; x=1745360568; 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=kCrss/vrC4UmZ9HsX+MwrpcfoJAyl2M3PrpQZBwb0YTg5AQ99wIBcmCu+xBfqjo5U1
 QiAYmcO+VwkIjU6EAhHtNxNrMTb8YpUDBRT7kK0TtyYv7GfOkZyzx1N9Edh/zeapG5JJ
 oH+lh/YHnQqgg1vIlhY8wUi6Yd2XHbcQRtSaLCtXoxU/pozjMWkUJ99+7dB8svFEysXZ
 E+x4rBAcCrJr3woxSrNuSDMAa4FcnlYcQeS73i2GU7ZrQwwGBUskZmGd9GwBV+sKZFc1
 T4iN3lFY6vcHT7O7jd9raUCOp3eQPiZdZdG7vPODBFbXybC2oeHxYbuWLsEf4L+htSDC
 Qk5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1744755768; x=1745360568;
 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=MBnszc/+YfEgMw8W7WiiRnXb1/CKKZqe2cXxggLO817mfBSBXVNb0WqlqPPeP8UfXN
 nURAhtqflt3pd2WdPOWdXSbBJktdf9fQY5ehJ6JdcinW9aZvMoa6R+6qwruCuuR1W54/
 N0gwN+n86tNVLbtDk4A5gRQW3CLn65Q7vSD1O0QLaJ0Hm2YNI3sISKRaKRjtXgmUnhod
 j2b5gnS1XQsJN0KfjgTyA2axZvOinDCU3/PbQCfTop5J62VVHrLvugpFLxvLGLab+WoU
 43PPVrDo0Pi8ahESPZIoBeXNlI+juyMadvuzUlWELbJL1XgW20lIrMrg14pCwiSBKQdi
 3IFg==
X-Gm-Message-State: AOJu0Yzk9oRbg24ubonVVoVqpKC5fAY8/Fn44l0+G9i5hgXfwyo0E1Nz
 Qp1ajGhDLYDIbjk2bIyQ4f36eWQh3BqLQzblyFEH3fcXcTvCBm2/Z8vsnFgM
X-Gm-Gg: ASbGnct5Zm2WT1KUT5cTL9DIrr91Q9lTGF0YH1KudBNGI8o3/uZaFeCRnPqqXLn760I
 2GkXVKzBFfTYZFkdpluaH4v5InN/LyrDFD+NJvsRq4pKRPAzY5rEJKq3KW8H5o8BhSjL2t1elG/
 OEcKkAj6cUfEd5BKjVL9xT+Ecd3xPGXdt6zNdFZXBXQWx67xm5FwcOat/235vvQzcKcs6VxtehW
 A3X8IdbSyM4dkH6w9smrblOuBGy0qdxHDmkoUMCzPIvr4hgTLEv3e53oPqlelKMYZaGujimoUkt
 wM0e63wEHf8MHD5GkQ/cz16yF7i/GJPIem5qvaIQFs1Pbjlo3HqmYmpoeHUdpjl8+9o74p4zoBq
 fo2ToqoyTKYiw9b5Ar5Y=
X-Google-Smtp-Source: AGHT+IFyacDO5CMJK7wA1IMclfuVOz/U8/XpFp8dj+FOZ7/sm1MyV9ZPJZEvUsqj7Ye/XRVWHMfPzg==
X-Received: by 2002:a05:6830:700c:b0:727:3313:563d with SMTP id
 46e09a7af769-72ec1c10873mr812751a34.18.1744755768428; 
 Tue, 15 Apr 2025 15:22:48 -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-72e73e4d7edsm2576615a34.47.2025.04.15.15.22.47
 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
 Tue, 15 Apr 2025 15:22:47 -0700 (PDT)
From: Romain Beauxis <romain.beauxis@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Date: Tue, 15 Apr 2025 17:22:35 -0500
Message-Id: <20250415222236.78392-8-romain.beauxis@gmail.com>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
In-Reply-To: <20250415222236.78392-1-romain.beauxis@gmail.com>
References: <20250415222236.78392-1-romain.beauxis@gmail.com>
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH v12 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/20250415222236.78392-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".