From patchwork Sun Sep 18 20:27:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38035 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp859066pzh; Sun, 18 Sep 2022 13:30:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4bFCIMuABomddV/KTvJlVv5DhPBgJjULICwAKL9cXO9oMkbbhD5yw13ieqMcIaq8LuA39W X-Received: by 2002:a17:907:31c1:b0:742:28a3:5d08 with SMTP id xf1-20020a17090731c100b0074228a35d08mr10493132ejb.112.1663533016762; Sun, 18 Sep 2022 13:30:16 -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 q8-20020a056402518800b00452e7ae21e6si9144472edd.286.2022.09.18.13.30.16; Sun, 18 Sep 2022 13:30:16 -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=FBbogH9N; 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 F1FBC68BC09; Sun, 18 Sep 2022 23:28:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2055.outbound.protection.outlook.com [40.92.91.55]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BFB4168BBF1 for ; Sun, 18 Sep 2022 23:28:27 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l0SVuDc8KkZA5BpqHiOXa42jI6RbzvSjmlu0WOg3FKm/2MaWdCegOoq2+zVLD0D9M657UtQvflvE1F3VOi4AMXakOcaGT+WOEctWllRzDaTR8Pjmhlfj3Y9OD226d0kIaxNhxdSkhNFdVXhAFtbQLS/r8kcqPIsXqk2vs/TM9E8As2N7wDZNUs9+y25OwV0/wB8Z8oBdc//njsLrikENN01o4I8qrvsfOEcCoI6cTy9Oir2THE//u5qP/lP2F7ZJ7SZfgPksEJoIOEMUCd39LNX4Gpvats/4jHtt5vDCNHbwGjG2osaa/7PKiYS4lAwb+xidX6RlIl5igkeSa4JAWw== 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=svQg0WN/nIJSGHJSXAHNIHsYY4rX25UvGsuDtbI4QO4=; b=BIBgvlVLzaZnkPJJ4i2Hi/iacVPI2eZurCh65bpYnXK9sNI4mQjXQkXrO9UHIUczH5eVRkxmlshE+I92KzmRZWEHsrqFVORQlv9Ob0TaqX0mxG/D6oLXpP+mCgV/nijGEmTYKbakA16KqROvi4w8DQOnPiiQaG05yQIMT06y1wv0HiQLXQM6ohIUtsIUzQDeowI1yu/KK+m3emHw5Yp1gLY3LIoBZ++Q9E1VcAix+FjIpNqGdYvGqf397Z02p0rotwese3zJ9ul5fKIjHAVTQArwUs4fKqGt6Ts2tOsltsSfyJUEVjGddLkVAHX/aa/ExS21MELZQv9bkVT+ksnhcA== 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=svQg0WN/nIJSGHJSXAHNIHsYY4rX25UvGsuDtbI4QO4=; b=FBbogH9NHO8aySolKSAwgGkMTCq72b6+519ziQGNRRiLxYTMAoz24xRtYwVKhdvtlp+Ts5EZMytPGgaulQ4btIUIqUALUMpLTd54LZKDT+8kdGVFQiai9Wr1oUJJnVthdAVjY17t03ALD0nFI5/ARql8UefXtCRV1c6TytWMXyEorY7bHeS7XIT0KDR8OZN70DEWo40L2xOrCqsiIb7mCnsTNdC/Ke31BtpTs3oNpQxgBeaGdbatlvSP6REUrIGrrZy7OsOpSY5s8hgEcnT9s9nkMIOsHnQgGf2zS6U5sa6a5MYVBEHZL3tD6AV6H2V0iBcsLVdMW88tQJFYkJ2zbA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by DU0P250MB0484.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:34c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.19; Sun, 18 Sep 2022 20:28:26 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::f3f2:4362:56:4785]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::f3f2:4362:56:4785%7]) with mapi id 15.20.5632.019; Sun, 18 Sep 2022 20:28:26 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Sep 2022 22:27:56 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [QEUmoMqVYdC/cyTT/9JMI+CYGSFUPWfW2Snb7w8eJJU=] X-ClientProxiedBy: ZR0P278CA0109.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::6) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220918202757.2345415-15-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|DU0P250MB0484:EE_ X-MS-Office365-Filtering-Correlation-Id: 549e26eb-ec66-4fa7-3f30-08da99b45713 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmo7HDJh1DrTtIyfVHMwSN51BgQgb52nD6KJJc4buc0q3GT/e9HKS7DtSxOFAIiaZsNnDjm+k/ZxfSEYhEgrmbxjBR6f1E3+PF0Xyn0+l8BP/gG9d64oQYh9ee6rM0PkQlzTc5rVnqP1qLPKLHFJzPiE/Rl758cyIsTnh/yyZaU9I7iZAEKWoPO/6MLJD4Cw5DME5XObB0UjlwzseRfmVLyBV3Ndsf/j000UIL5FuwoxS/3XSyDGY7h8PLc2DtIuqgXUTeKmz1FDZFHBCjcAiKyA5ecBTHLjhcNYElzHwMJZA46aw0j8sd4V4t4y3ydMr3XLY5zrwYm+n9fpGSQOtG038KKXy8o2Slb/94Tru4i39mI3hztueEb5qzIECBBe4csZgccpJ6IldEPvd4H/BwqMeYaEAodb3rqBlAgkjPzzH1jbCz//MM0KSojCxToVlnuyLtJEWw2wPmSe0vA5McmvZMLayXzuH9yhAxoFdItcFSrnJejrEkUMYrn9spphzJpNR2cK6Io7NJ+E4lvUwI4PZcILjWqMJHHydeov2TydIDrPSOhHvRrFRCRlvidqn3OjkHLPbQhyhDi1UVHVN0frYr42aMyi/bokIVl5M1k2kg3KOl0tZa+xYyOv0073fVum5YJsBnWAT7QBlp5VCCCf4N8aL9TdtdVOCGMv8tFPDzzPr6vOpdiops2e5vaeFXUcU5kBrwkxHOLlP+XfKYSBgcFieZ06VAvP9EzcFL6YQr5ZIbtfdIcLki8TNY4XeRE= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c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CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2022 20:28:26.2107 (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: DU0P250MB0484 Subject: [FFmpeg-devel] [PATCH 16/17] avcodec/dcaenc: Remove dead checks for unspec channel layouts 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: sPx+cjQ5uS62 This encoder has AVCodec.ch_layouts set, so ff_encode_preinit() ensures that the used channel layout is equivalent to one of these. Signed-off-by: Andreas Rheinhardt --- The new channel layout API is more stricter wrt these checks than the old one; the old one let you pass if channels was set and channel_layout unset. If this was not intended (or only semi-intended), then setting the channel layout based upon channel count should IMO be done generically in ff_encode_preinit(). libavcodec/dcaenc.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index d0de6d3eee..0996296d8c 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -222,13 +222,6 @@ static int encode_init(AVCodecContext *avctx) if (ff_dcaadpcm_init(&c->adpcm_ctx)) return AVERROR(ENOMEM); - if (layout.order == AV_CHANNEL_ORDER_UNSPEC) { - av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The " - "encoder will guess the layout, but it " - "might be incorrect.\n"); - av_channel_layout_default(&layout, layout.nb_channels); - } - if (!av_channel_layout_compare(&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO)) c->channel_config = 0; else if (!av_channel_layout_compare(&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) @@ -239,10 +232,6 @@ static int encode_init(AVCodecContext *avctx) c->channel_config = 9; else if (!av_channel_layout_compare(&layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1)) c->channel_config = 9; - else { - av_log(avctx, AV_LOG_ERROR, "Unsupported channel layout!\n"); - return AVERROR_PATCHWELCOME; - } if (c->lfe_channel) { c->fullband_channels--;