From patchwork Tue Apr 16 17:23:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 48090 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ce4e:b0:1a9:af23:56c1 with SMTP id id14csp509307pzb; Tue, 16 Apr 2024 10:23:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXy0kGVmO5McXOiDXMzcnLPXfDr6EZ1zO40xaUkeRZNJ7knREhDhznrAHkxocL1c9kh5etCgmQe7VB7N5GrQSrrO0prhXBpFeBtgQ== X-Google-Smtp-Source: AGHT+IHk3wNCvk4Odaidf+G0uOwa2aayProzyhTPh/RQu7ocYdBb9BmuptOXrbYvmQS9gQ3cAXap X-Received: by 2002:a17:907:983:b0:a52:19cb:fb48 with SMTP id bf3-20020a170907098300b00a5219cbfb48mr10583504ejc.77.1713288227231; Tue, 16 Apr 2024 10:23:47 -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 gn26-20020a1709070d1a00b00a52263f5089si5845865ejc.836.2024.04.16.10.23.46; Tue, 16 Apr 2024 10:23:47 -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=rHS69WT4; 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 AA81E68D219; Tue, 16 Apr 2024 20:23:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2089.outbound.protection.outlook.com [40.92.89.89]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 17C0C68B22A for ; Tue, 16 Apr 2024 20:23:37 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T48NqP1PXrAI6pmWMPBrsrKnkq2B+BSSmiPknL4Y8z1+Xsvt5PK0MCaMHVeyT9YWVV8od/ScOgEGL3RetWqqsp3c0/uxqdBy0gVR28H3uXDBNT6/zKfqVf96iFgMRsj+PUqWkrSd7J38biPoIMzfxc8f37dWlfKxiK2Pbec/h1u6fB8MPC3iLSPkCNa5RH4W/VExVVYmJUSXzZbUO8kRElUNlAjrbOW7/+9QstmWv8LM9dDpzLXPDGRRvjz5xM8G/QJ9fk6E6EygVchuCTHwP/ceR34MuHf2Y+irMrl/CVOYBPs+Rr/ZBwIfd4/yJTmuD9G6pej+qosnCX+fiLZq3A== 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=bLZ2//B0ksUamCMl/q/8m1zIp8VJCXZStNdIlmTppxk=; b=btb0quSw8ADCXLzlyt1fYfWzxrwcvDD6ITEjWHrq/uU2UaJZR65d6317cbYuTPd2/DuWhBS2cvmZBAHdSr4MOeS/EVD1pOtnIgsUKfOKqqP6sZaQhLTsmn9io44EZO88zAe/biQku5MXhX6KgBY/9e655xdAPiJt5xNl8T9aqNbmMUCa2yAM2lnxi01Y0xyQVkmt1iOxcGn/ZjgYhttI0CWK87CXDx+mIJXdmOyMGMhUTZJtNxR8MNbvIW3UlGFxa3v8H5MXDqewDNeyFO1dnnnHbl5/8qp2QNFi26KyJX5cEwWRNKFdJhA9qidCcE5pKNNSf/OrukZvFAklvZfrhw== 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=bLZ2//B0ksUamCMl/q/8m1zIp8VJCXZStNdIlmTppxk=; b=rHS69WT4BTtLq0u3W5wyEuPg8pappa7qGj/1vEUM29Go7TsapdSlvTUuzTsZwxyjEgFaEp+VQXQ95xxfSCSOrWoQfee/Da9rOSew3Xxz4DMVxTUBLB4rFvqCASJNeKRmJt+N8DuTkmJ2j6ZDUdgStB1dLSXvEGagBIIutNAOv/GV7/EBWPVh4Q5dzbSTFhQy1G650XcbIkBFaib3u/UeaF0bZV9YyH511BbxSHOShktZQVZdUJ8MXVP7KuEAytO8EQi8Q7LZL3NlsRTSI4Nhez3WeBd/MMEV1DM243thKqFuvDVyoTYm+qwHmt2b73GO/warCOxI6K6GntruaIlAnA== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PAXP250MB0495.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:28e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Tue, 16 Apr 2024 17:23:35 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::1f29:8206:b8c3:45bb]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::1f29:8206:b8c3:45bb%3]) with mapi id 15.20.7409.042; Tue, 16 Apr 2024 17:23:35 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 16 Apr 2024 19:23:27 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [+6Vul/OHgu3/H6faujjWtw2l/jPZ+utYE0DDDU2JB6c=] X-ClientProxiedBy: ZR2P278CA0031.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:47::12) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240416172327.3294620-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PAXP250MB0495:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d666526-55c4-41a7-da7d-08dc5e39f245 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PJSPXJvVSdb5VPMQ5jNL8slApT+V2eAe47oGTpMNxA2wyX2GYdyswPS9en1VGRt+kJgZaNO7TwJDz0E7EWVReWOkSBJcZ3728RUwYOTECdwe3mfxCkZ6H2yT1MajMKoNE0QENbomy+2zjCUHCPqbpswFszD6h+GcWbUs5AUd7+TVhgATEAoUhWoHJe05Lb8G816c0n0Hx7lZSMxjaQR1ot1PqYj6OKz5f4VzBUeVx3e9XaRXkJ8zLgUMrEKh5ChWlOiYvV3e0YQQMAg4dlTUb5DUtSiFEWKczTObdlzXejPaVX+wTcGG9cHJyqgVkdroVeCruALb084Rnw9lVW5iTOcmkONcoyyCildxfUmB7MlipLiMzTjg2BZW3l6zEV29s+Zjl00MnN0Guf9a85Ma/3oufxVPn6DEcq/qRJydoupS5fsMgUeW9N8Z+h+Ga8xl+BiTgpabp1DQ2RBgN+ZtKfFC7n1hf3sAmiQfOMUTiVSUhtGEzNYBV7XNk9rdum84M9M0tWSm8eP8lE1A1SqrdLHTzSzTed3yt3ppMZ/0xSnJ9Nm0S2dblnruvdsFcPuAmjerUm4VnyF7fydXaEKwJF7ojecaac9F+i4X0TDTWyYEQPH1XcU03cUznmtck2S/ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 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Ijh2RoHsVlXA4gxAYqEdEDIg0bLeUe1CbvCCw0F0pjap/2WYoWJjh/eb465jP4lAUlXC945TzZibH/tGHmDj1bjcqsWWE9R8fQpCH1al7snDoRcg2KlbgU/4DNqMgneCbIMZaUoLLOFCOf7eEHvetj0DeCpB4h4q32Oy5o21Z1FQMSkOSjtUS1r1gjv2zsHUt25w8ml0Vei3xSmrxnbSLRyPpf6pVBL9jYgAlIvbaXtkNH2NQNluhwcB0cXw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d666526-55c4-41a7-da7d-08dc5e39f245 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2024 17:23:35.3133 (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: PAXP250MB0495 Subject: [FFmpeg-devel] [PATCH] avformat/lc3: Only allow AV_CODEC_ID_LC3 in muxer 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: nLOgV4EmnGXP Also check for the number of streams and the AVCodecID generically using FF_OFMT_FLAGs. Signed-off-by: Andreas Rheinhardt --- libavformat/lc3.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/libavformat/lc3.c b/libavformat/lc3.c index 93ce720af3..16c12a98d7 100644 --- a/libavformat/lc3.c +++ b/libavformat/lc3.c @@ -186,16 +186,6 @@ const FFInputFormat ff_lc3_demuxer = { #if CONFIG_LC3_MUXER -static av_cold int lc3_muxer_init(AVFormatContext *s) -{ - if (s->nb_streams != 1) { - av_log(s, AV_LOG_ERROR, "This muxer only supports a single stream.\n"); - return AVERROR(EINVAL); - } - - return 0; -} - static int lc3_write_header(AVFormatContext *s) { AVStream *st = s->streams[0]; @@ -243,8 +233,10 @@ const FFOutputFormat ff_lc3_muxer = { .p.extensions = "lc3", .p.audio_codec = AV_CODEC_ID_LC3, .p.video_codec = AV_CODEC_ID_NONE, + .p.subtitle_codec = AV_CODEC_ID_NONE, .p.flags = AVFMT_NOTIMESTAMPS, - .init = lc3_muxer_init, + .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH | + FF_OFMT_FLAG_ONLY_DEFAULT_CODECS, .write_header = lc3_write_header, .write_packet = lc3_write_packet, };