From patchwork Sun Sep 18 20:27:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38024 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp858625pzh; Sun, 18 Sep 2022 13:28:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4fyrEGcdyJn8Ehgi7kwggm9vyki2eb2JAOQaj4xMJpHryyguvxbNJnNzr7g8maIrf3FA4v X-Received: by 2002:aa7:c585:0:b0:453:e1c6:7dc6 with SMTP id g5-20020aa7c585000000b00453e1c67dc6mr3302555edq.245.1663532920822; Sun, 18 Sep 2022 13:28:40 -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 p10-20020a056402044a00b00448ec02447csi7098552edw.144.2022.09.18.13.28.40; Sun, 18 Sep 2022 13:28:40 -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=olAchxXL; 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 1108E68BBED; Sun, 18 Sep 2022 23:28:24 +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-am6eur05olkn2081.outbound.protection.outlook.com [40.92.91.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 55E6D68BBC2 for ; Sun, 18 Sep 2022 23:28:18 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ad+AUD9HGi0EFiqGr9R9yE1THo5SYkxQEEZe42XF/+OUsxpBrljtQfKe0XCykUCoefZk30jU0AbtqxUVYCMwBIWd0qiNVaytAG8V82IiAMEreEJPsCAvmLDNuBn9Zqkhjt20ZICoBtu1F3D74fyeGRdUDn1ywWKy5Isl6bjvc6XewPSDaf4lQT/lcUurgDuLCuu30j/xmKTUJi5Sqh4i+HyhWO0Q4f2XkTXixf1BABrqEZ4sp63RsG6iXB/K1p4qKgT5uD0tQBawjetAOAGImbd8stzmWii05BTv825n83pHLbka2luZf/OyKK0pN+pp7C3xYQKOg82qD13AwN118A== 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=dK6BD2Io6oN1Bwwy5eu8rTd1eA/SsmVBcuqsQOdFGlU=; b=BRP7Ax1NCduMjRczDG/QnaE49tNoxu9kEw1jCI0UlRbf4PU9kpfWK9z244AUe63fK6nU4kfAvB29PDPl/f/4O7j/UaVMgB3g39+Y4a1JKug3tVSckt8IBm1j1ZMNca9bTITh1hKfLpVzZ+b+i7fEXOWMAREScXtMM14qfZgiqmsCclqeBILaL18AONZm7tY6Wq6abxQaAc4rkpJWrxTBJkohsyP6WSDTwfLjCofjg31ydzUz955Ldnc6nGKTCsMNrjKiWezuZax8p2CrQu/G9kHdwaKh00ARPIdZLiPH9sd1Kk2aVOToEczPUgXloMhBOuptf97u5PhCBUgVBo1eMg== 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=dK6BD2Io6oN1Bwwy5eu8rTd1eA/SsmVBcuqsQOdFGlU=; b=olAchxXLo6SBsFbeIvrvHfW2OrHdBHdKKShtbzGlDsBf22xak39Htabj8TFZ9DezoztqBj+Pd1jfWSR2t2ddYlJd4A5yhxOUwtktoeOcwCElSdPdp+CtsT7KlszWbB8fX3Bf23gQpitUC7e23sxCA6PS28jQusKzXQJHRy75n6bIP7vyW8XdisxIkjosJ2+l7wulL9nv1cxrz441h7SJI+QOVVG4xREWCToVZQ1nZCL3EGJTq+LiCYDu0EVv6kWG4IgdkYi1KmgGOKPbU7sMH69N0xYKDUg223IfGDwda0oJ0aIF3Wdmnztsa4K0VNSE2NkIBncaJgoYfPFeQNvvHg== 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:09 +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:09 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Sep 2022 22:27:45 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [xzkEbsIJR1QFbc+L/l4sy6hRbPkU71E2XoJdDZ7oN9M=] 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-4-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: 1d8a1908-1d49-4054-fd48-08da99b44d1a X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmo7HDJh1DrTtIyfVHMwSN51cYTarY5z2KzfQDpVmkC6WMU1HoY40L+iOoaCM/DuauFLsjT6N9K1l9a0YsMRXFPAqgXilYwFEX3px7iCGX5aPwTWls1dd19TbuUcNdcJDDTJttifp7h3KQsx4UhGJIeizWeCxO1cqknlTgrkEAXHZSZa75/6AZ/Ff32Km0j9x4zhndFGLcFCqecAWb0m4eo0vRF84ken9Ezew/1PyQxfnL19ZAMC4tAQtkItnJ12EwYGWTECCDGcCO1A/jS1LFePdvdGNeAW5TwIoyVRpnw9flWFdRvab9TQf6PvzNvAFS12/3Iav+6o8D1vdqgbcvPba4DRB3ik7CGCGJqsU9QmbY2UUZAqbHc+kmuv6OUf53LYuSQS38rJBeOYfBbKDL+NaoER6Hxv4jGWnlUUS2DEze8sP73BZusbGAWJnuWI5ANuSHL8GJTRDOivphRXENkCt8xCFQzGeP73ceY4RKV4IpdtSTZQe33ra7I5dnkqhI9V5E03BQszU/YlJGJ61Fi8sZnhJN9vLBJcfxRyYZjqMWEsklbp145LaUjbQALadx86wv8GF/41xr+vRYfKBHIbaAiu5/uVnh9IH5BESlXk227b3uNnVPNgDLE+u2m/2BTtgH2TPfhvgCpoK797jodIw8Xvp60YQwlqwhb/1cKGw9ze9xOnbgQkHVYXykyJfj1OF7p5omSlbpBGVnRxTjOoghK6XjR6aKiqDwTnw8sMh27F9mRhO3ouLQzZuEbxVWI= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 29ePKX2CQKew0tqLQkc0T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PwqheSxmRCCoyBjohKp9v9HsN0eOk9Zue2ZCgn032rVjNm7iU1LV+0B2Gk71fFrdnCq3AmeeFG8/J+1DW/ELVm1adS3Ihr3e38FeXhEbxPAUzbKGEawR48I6jm2yP6aDswSqBUb8zpPy7S/998uFQYd/BkWqDh8SQepjIbebYzrS05lxHcYY3LsJKDIuZub1DgrEUOqFnK0WCgvqyVx7EZfvBQXwTZ1nh1WvfTThYqUHVb1SG/ElZlIxcpd0WcxSQ/zLnCnom+msjHeYJ4p/CCdrf/L+EGOFMFE3BX9/zJ2Am7AoXQjE7Lw4tl7Jxe2YLyjGyMbkVfnlE4H2ohvTlpetx27zPRdeXxZpS+welY143FZ6TYO7VLLt8ZgPQsOwYsTmILfIX9XsN4DpsTj596sinU7Cr1X9BlaCTkRoLBOt1q3an5dvLd9ZsMMb0gh+Ps5GwZ90IxlV5xDFoiJ2LAsiGl2RWTnG7Zw3D7ELSl+nAHuDEUIfZa8navsjXrlqF9nrowIe3JAory6xYxCmB7gRySnWZoU8TEVFg+sMOF8Ff0VzNO92vxRDypbhQrF4h0WIg4m31o/L4sqX2WjWll8G8hzLRTdX4135shPrmIZWs/GBEyA8s6jFrPV2jI+VSNnPT4642mBZ3z5G1ydSAMbFI+6TmYtDQ9r9+e9QsDidsENSFI5LpMiKeiU8ygczMENm65tVBZu44V5il81mn5Ht3IN18QnghvE440cdO1ULRzVQv2/SktmcCd4tN2ZWXBIK1+4gRjhWzCbmzrJLTqNNSqnoos0gastzQ3E4pzBaLHESdk6X4XmN6NZEqc40X4MljjEdnaBg6nnIx0letgMsvt+3iwaaxRXJ4NeX2nVCVrmxzBbH6h2eLKLf1q3QyVpeZqv8Ss9T9jQdvP2xIcwU/IhJI4XbcS8= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d8a1908-1d49-4054-fd48-08da99b44d1a X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2022 20:28:09.4854 (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 05/17] avcodec/encode: Remove deprecated always-false checks 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: oEOdknRNvcId Now that it is ensured that the old and new channel count/layout values coincide if the old ones are set, the consistency of the AVChannelLayout (which is checked before we reach this point) implies the consistency of the old values, making these checks here dead code. So remove them. Signed-off-by: Andreas Rheinhardt --- libavcodec/encode.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 92e8337227..d1edce9edc 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -612,26 +612,6 @@ static int encode_preinit_audio(AVCodecContext *avctx) return AVERROR(EINVAL); } } -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (avctx->channel_layout && avctx->channels) { - int channels = av_get_channel_layout_nb_channels(avctx->channel_layout); - if (channels != avctx->channels) { - char buf[512]; - av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout); - av_log(avctx, AV_LOG_ERROR, - "Channel layout '%s' with %d channels does not match number of specified channels %d\n", - buf, channels, avctx->channels); - return AVERROR(EINVAL); - } - } - if (avctx->channels < 0) { - av_log(avctx, AV_LOG_ERROR, "Specified number of channels %d is not supported\n", - avctx->channels); - return AVERROR(EINVAL); - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif if (!avctx->bits_per_raw_sample) avctx->bits_per_raw_sample = 8 * av_get_bytes_per_sample(avctx->sample_fmt);