From patchwork Fri Mar 15 16:42:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 47112 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8c91:b0:1a3:31a3:7958 with SMTP id k17csp370488pzh; Fri, 15 Mar 2024 09:43:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWUqooZtxt+4U+Qwo/VEqz0LKfKuRxIRXygqFHEO+Wi4tJHjsdNoNcRbwvird2AVlvjE0LmfS2bC94mGK2vvkdZSHjmAKEbZ/UZbg== X-Google-Smtp-Source: AGHT+IGATToO76C4Oxd4LUUu2AJn6QbFtX9g95RzI+aAphTaiH1qofRr2nOPbK515L5u4kZv08vU X-Received: by 2002:a05:6402:390b:b0:568:b48e:bb2 with SMTP id fe11-20020a056402390b00b00568b48e0bb2mr1578602edb.25.1710520992176; Fri, 15 Mar 2024 09:43:12 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l18-20020a056402255200b00561d0de3e07si1946545edb.255.2024.03.15.09.43.11; Fri, 15 Mar 2024 09:43:12 -0700 (PDT) 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=@outlook.com header.s=selector1 header.b=NTVg6gCh; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1351168D137; Fri, 15 Mar 2024 18:43:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03olkn2050.outbound.protection.outlook.com [40.92.59.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3A9A668C068 for ; Fri, 15 Mar 2024 18:43:01 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xsp4u5AzcMV2Kb2/0hreqqop7vDpVxHDPTggO42w3ZghjLepZaj4Lbq472Wn8SFXp0jlfD46Scr0tczOZpsnWZEorkROAvqYFvS2FODx+o1bg629V1jY2pkKEfTOBVWeOtefav/BPVNDo5zALX854csVHer1ZMjEgn71uG3hcWiIs6WUIUrThbKAM6O5uaQ18k1wNF/2hoz3XHCe0z5AYFpQDmlsi3XSpWYea3/0g/ndEQZ/izRps73AO6VElJxzoEf1YEQZdxduUAm/RhCXoXABI61neIyo8guNN4YPpZtSRTjy8e38Zk9mbRYtp0Z4gPm/aOfm5nFO+g6pWl2WmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6XfJwOYphET5a1clQN0kYNpqLAiOOi9LNAmhyh29fNk=; b=dx71yMJw/84t72TB6DzeOrdtqoK3PPr/t/TARygSFptbvdJIlwN1so7PFi0xVIhi4yuyoMpQFx14EuV7q8e5l4KkF44ogIWBcXssNX3HwGXyQ4Oe+OeH/v9KA06q3s12XJAmtC6HS08n6HjpiR3b9B+abNhN4lMDK/LUHZz42rIncVbsfcRpWL8TNqm6OFB4hxcIAHR1E5T2y2+A7gWCn1Hw2L8a9gRckQUQ40HFND9b7PxrGCjXmYOaiHvJ+uniInzGpWnndaLVINUe3AT1/JaoJPoUE80dPC2y9ZkQq5VTV5PHmXHayTb8+A0T8IhkNBHcVmVx8KO+Xkj5ExbLeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6XfJwOYphET5a1clQN0kYNpqLAiOOi9LNAmhyh29fNk=; b=NTVg6gChBljnXC3xdL25MyutnxK+sP2aKJqjsX7fXfp9AZnXF1osS5UCBHRW/Y0LsD5JH2Tdp7BZSxGbknYExfZ2MLvUZHchHMG4SjdIRsyvr+9toAYRS+zOLDbPqCQ/Ozm3DXDG5aRWcIW63E09C7C3OeBCz49EPjk4WRrBqY/SwMzAR42oJ60UEu7ZNqkQ6e4l3fkv9wbTufZVPFK+ey4aQzdF2qyy+ELoiqS6wC4CP/59D/60LnLID35//8lE/dKIaAgG7AvXTnLZfudRfWmeqSOIprTYkR9E1O57miFl5mpSR6XsGye0ieBQi8XlTmQtxXnCVP2/OdGGIU7O5Q== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PRAP250MB0592.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:29f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.26; Fri, 15 Mar 2024 16:42:59 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::228d:8c6f:ed10:82eb]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::228d:8c6f:ed10:82eb%7]) with mapi id 15.20.7362.035; Fri, 15 Mar 2024 16:42:59 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 15 Mar 2024 17:42:49 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [L456qQXVidHsQh8sK2r+QQ/wQogajvQD] X-ClientProxiedBy: FR0P281CA0109.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a8::9) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240315164251.64758-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PRAP250MB0592:EE_ X-MS-Office365-Filtering-Correlation-Id: 80f23284-aa06-4bae-e1ff-08dc450ef8db X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JFIX/5rQBkEyPPe6prQcNrHa6gu6faOw/wCPF8rcR4FTLvlICH3v8sgqxSyvKH7gAoyFmpYxVLf5XmH2muKK0pI/xPuNas0oAs6WOP6sA8MJkBXuqzF0P5ORhge4ELEOoWH9EqLf8FXC+WG12D4EJCkszCdKCsoK3PBZzIVogjBBFX3gwyxlyPxLeu9uFnn6dFPcndLf4mtOrP9j/aDW934ghxYdIpaytKZVaG3pkutPQPl+Ml6EsGafOo1W4hX2rJ/QdODoYte5k5VtZYMx8XJJ4+dferuxs4w/xFm/eAE75xOecWAXjbh20RW+zsoydeZtusvasIlphvPGoDAvh6+bMxTW9hOhAafdiFWqquuQckIJOqrhabTuSxK6MnXw8spyLHNA++kI0jJ1wSwVRHRv2Zo6TpP9kZuNWqVTXX76a3JZkJcvkg2EKmnEz3HiDIgNq87jwxDjdQEIF5lknend1XJI89W+uRwc1NIYOZnDJGB+8+2h91EMVXuv8itjsd5qU7yOO2TqJCDta7b7ZwaAeLAa4b8iX0xLEABPmezT69lNdtXgc3VxlYmxWw8QUh4o92s5DQNxlLot9EaxLRpYZRMSumHnht0oHm1V5q5PiEfKWNjmaWng/M129EJj X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hh74fGpJcfOsASg6ujHpblY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Scks+z5t4hZLzyhceI9h82VV7F6tu+xiqN95dB2sjGyDMC6klN1NdstCfqmgUscnqbFaCXm1LZ3sppMw681UhwWTTxqc1hY1Thisl9KEgneRocpu/yuyZGuNtIRYMXz0X/sB6M6j+/oRu6eKtpeg9KKY+W7PvzU4X3e7VR33vD4AUWUJkYwx+vcPOVKR271i9cZWoADbyUbqMM+yA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80f23284-aa06-4bae-e1ff-08dc450ef8db X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 16:42:59.1782 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PRAP250MB0592 Subject: [FFmpeg-devel] [PATCH 1/3] avformat/aeadec: Export title 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: DyvuSQGk6kMN Signed-off-by: Andreas Rheinhardt --- libavformat/aeadec.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libavformat/aeadec.c b/libavformat/aeadec.c index 4cb2da6639..20170a89b3 100644 --- a/libavformat/aeadec.c +++ b/libavformat/aeadec.c @@ -23,6 +23,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" +#include "avio_internal.h" #include "demux.h" #include "pcm.h" @@ -59,12 +60,20 @@ static int aea_read_probe(const AVProbeData *p) static int aea_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); - int channels; + char title[256 + 1]; + int channels, ret; if (!st) return AVERROR(ENOMEM); - /* Parse the amount of channels and skip to pos 2048(0x800) */ - avio_skip(s->pb, 264); + /* Read the title, parse the number of channels and skip to pos 2048(0x800) */ + avio_rl32(s->pb); // magic + ret = ffio_read_size(s->pb, title, sizeof(title) - 1); + if (ret < 0) + return ret; + title[sizeof(title) - 1] = '\0'; + if (title[0] != '\0') + av_dict_set(&st->metadata, "title", title, 0); + avio_rl32(s->pb); // Block count channels = avio_r8(s->pb); avio_skip(s->pb, 1783);