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 A82B34D872
	for <ffmpegdev@gitmailbox.com>; Tue, 25 Feb 2025 22:03:23 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E2D7B68C9D8;
	Wed, 26 Feb 2025 00:02:04 +0200 (EET)
Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com
 [209.85.128.179])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CAE6B68CC5A
 for <ffmpeg-devel@ffmpeg.org>; Wed, 26 Feb 2025 00:01:56 +0200 (EET)
Received: by mail-yw1-f179.google.com with SMTP id
 00721157ae682-6fb9dae0125so52208997b3.1
 for <ffmpeg-devel@ffmpeg.org>; Tue, 25 Feb 2025 14:01:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740520915; x=1741125715; 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=q5OeNROkFB85pZRionDphPl2ghM2Fdrqxtf6GPAYeYY=;
 b=U3N0JnVWJpgOi0l4Duu63s4nMFEWeX+FJCPZPnF5RawnBtAb6+uCuC+92KN4aM4JxY
 HJHAvITEZHMMSEI5Cky2zoFriPmR2Q0YPgCjMIA+jpbd54kEf6oqslibx15c1LGzjllR
 e1xFScIMH195RT74IlijRuAK3nFJsk+Pwc7vkkmXlmT0P3QaVEiwMvsQZPBqX8ZblO+W
 BTyP3O2cEPR1WHcnTagzzlHD48YotqgopLGIKK6/uqDVLJ/Kdc+DIcZqaWmPA3XNRmOh
 zijjoZzYSFQtbxQD14BCL1oY9CYkRgn98XWbwlWcaFmIBpF5f2Jcs/4ddNJs7gjad+eu
 KRsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740520915; x=1741125715;
 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=q5OeNROkFB85pZRionDphPl2ghM2Fdrqxtf6GPAYeYY=;
 b=gtPJ2ur+8COP058DUH5xDHTquviAwDL/fv9wGcVjIG/9xcgsf0rstrDUAO6yVvyWjV
 9O7xF7Ui2QpFmDlYuqe0dHK7rytyB1OZF/iSXBuIGWYAkNM92sLSxSubwPUhAe8FeNFS
 1htb07UVZH4Eyg50TDsQj9H+1dEi+/xIl+te2b8ApsLnfKFypDTnbLfRtWyDW2eF5uxd
 FcP4FqUPCYM27qn8XlLtsciMh039hivetmijf9dSsD1240H+VPD80Qrtk4e2KWTRZRme
 sxJWTEb6VsTrbneg/PbqIg/iaAVHbkbArgS53GJrfufSmjt7K5RPf9c4IpJIJ6Te0QhF
 IM1w==
X-Gm-Message-State: AOJu0YyGj6cidLfPBY47Ixu2F7Vv8xz83+XPHqEag7FgDJMrMRWTegQM
 WyjhKbwMfEHTpjroIG/6aA/ijZlxfygZNJvoYVckTewtID/UzonqO1r6Hy4g
X-Gm-Gg: ASbGncuhdTFzkQCzXpA/Phomir/Iw2XDjj4801vyQgcp7GwRwyFGHwCGZEuXJ0DVw6R
 YSWQ19Wh6PE22Kkcd8MpiiyYNBeQxCGKrUhwZ0LTErnqOf1S6PHbO5EIsTHElHv2WN5PjQfCX+s
 Rf3x+qcjiWkhpzlOC03LB9fZxFe8ad3yBH5REkdZuhmIiyd04jTMDS622+z3MwvlvkvdxZsi1HM
 RIdXpt6a1SvE9GCL6Lhuvk21uIvOcCkKH0cRt9lpjjvVrDejNM3OP6RKsK04roBXt4+I783yby/
 P/WnbNSe8UbHB+qUHLJG+K1BgMpSU07MshHSMlXk5dHqFGiV0/xqZ1J5On0/A4zqx6A=
X-Google-Smtp-Source: AGHT+IF71aKRp8tKbh/C802J7OCCxyGMCNPpbzuFQoWYT+JlydEZnISIxTBR14fHn+RFqMcSHMg51w==
X-Received: by 2002:a05:690c:4d45:b0:6f6:c95c:85b5 with SMTP id
 00721157ae682-6fd22076a24mr11827527b3.25.1740520914869; 
 Tue, 25 Feb 2025 14:01:54 -0800 (PST)
Received: from localhost.localdomain
 ([2607:fb90:e333:5b39:2036:1eaa:d627:4a51])
 by smtp.gmail.com with ESMTPSA id
 00721157ae682-6fd117dd70csm6487767b3.83.2025.02.25.14.01.53
 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
 Tue, 25 Feb 2025 14:01:54 -0800 (PST)
From: Romain Beauxis <romain.beauxis@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Date: Tue, 25 Feb 2025 16:01:18 -0600
Message-Id: <20250225220121.98449-6-romain.beauxis@gmail.com>
X-Mailer: git-send-email 2.39.5 (Apple Git-154)
In-Reply-To: <20250225220121.98449-1-romain.beauxis@gmail.com>
References: <20250225220121.98449-1-romain.beauxis@gmail.com>
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH v7 5/8] libavformat/oggparseflac.c: Parse
 ogg/flac comments in new ogg packets, add them to ogg stream new_metadata.
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/20250225220121.98449-6-romain.beauxis@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

---
 libavformat/oggparseflac.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c
index f25ed9cc15..29f5904575 100644
--- a/libavformat/oggparseflac.c
+++ b/libavformat/oggparseflac.c
@@ -78,6 +78,25 @@ flac_header (AVFormatContext * s, int idx)
     return 1;
 }
 
+static int
+flac_packet (AVFormatContext * s, int idx)
+{
+    struct ogg *ogg = s->priv_data;
+    struct ogg_stream *os = ogg->streams + idx;
+    AVStream *st = s->streams[idx];
+    int ret;
+
+    if (os->psize > 0 && os->buf[os->pstart] &&
+        (os->buf[os->pstart] & 0x7F) == FLAC_METADATA_TYPE_VORBIS_COMMENT) {
+        ret = ff_vorbis_update_metadata(s, st, os->buf + os->pstart + 4,
+                                        os->psize - 4);
+        if (ret < 0)
+            return ret;
+    }
+
+    return 0;
+}
+
 static int
 old_flac_header (AVFormatContext * s, int idx)
 {
@@ -130,6 +149,7 @@ const struct ogg_codec ff_flac_codec = {
     .magic = "\177FLAC",
     .magicsize = 5,
     .header = flac_header,
+    .packet = flac_packet,
     .nb_header = 2,
 };
 
@@ -137,5 +157,6 @@ const struct ogg_codec ff_old_flac_codec = {
     .magic = "fLaC",
     .magicsize = 4,
     .header = old_flac_header,
+    .packet = flac_packet,
     .nb_header = 0,
 };
-- 
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".