From patchwork Mon Oct 11 15:31:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31055 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3816306ioa; Mon, 11 Oct 2021 08:32:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBdGHK+WNtac38zwBY0TkVFIgc1Gxt72VgS4Tnd61j3U9GpV8jH60kvBvAX9hwXTcadmF/ X-Received: by 2002:a17:906:2b84:: with SMTP id m4mr26745848ejg.179.1633966343925; Mon, 11 Oct 2021 08:32:23 -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 ci22si11682499ejb.240.2021.10.11.08.32.23; Mon, 11 Oct 2021 08:32:23 -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=ZOoFOMYW; 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 496876802B7; Mon, 11 Oct 2021 18:32:20 +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-am6eur05olkn2096.outbound.protection.outlook.com [40.92.91.96]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 028256802B7 for ; Mon, 11 Oct 2021 18:32:13 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PEgM3koH6RfmvWrTR5LW0ZlOCy/+PF8daix5QQG3BNdJIE0nfVJmhgQyWzMMSdDle/thHa9N7CRCyEBsAJZ/THm9XEtgjM2zGWYtE0pPcoAXOsdxrL0RvBAduOz/zemRlUhX0yFTVt0hedyNB7NZKemRzgxsGx7rLkEmoHfjIWdRdMdaLUFAhNpemU+rCjEXmFjcc1AJfcYLTZNEE4anVCO0D5p1vmLZExtrruOG97iAPwKvAvVml/pc22yR2UXSCYSp7zlZ9bRRYW/iSiu0tBuKX46qp4MYo810Q0czE94ULwV+XTrBDqLwWjOSN+U0sdZjmVZmnnZ1tV24ChOYAg== 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=NHY6tOEiRZSeAFl9XiBf1nE4oNAuhEQkL896EzltkKA=; b=g9X9JdyNcKrnn8NPHlJIGfchkKZcoQ5/HIGKxs1PzU3hkqhJNsq2/WRiemHxZg1moUe2BRsGMFX8o5lBuKlosgKA2SQg9dME4kdJjqCDw8FPGsIR9HxIiJsftiTj4kut9oDqGX7orPlr8d00a6v0kB1ikUDn1tYu4eQDRvoyk4zkZtvUz/KY2UfajmCw2S0dHKVbazpH8IPWrXHS/y/OQ/1zKuiaybNskYgWojI22ZrEuU80QrFeXvNNANgM6fVCIFyNUd09FWgIrMbIgcQy27kWNOv9H+iYQWtagSsy7Qy2qzgc3F52ftcy3D9Z0h0Y/wTVNEHg/lSuDbTA0I72+g== 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=NHY6tOEiRZSeAFl9XiBf1nE4oNAuhEQkL896EzltkKA=; b=ZOoFOMYWsxWJrzMn36f/5gywZ8eDJE7i6QC4VIFXZdhJGhzq0heNZ8Xe5xqYWF7hknYTYRv1/WUE1zeKEGyukSZ83yVUu7TrhXvCyjov1Gxf13kUSJ/BC/yPuDIY0Mz6YrX9O6Rg8azUWk/u2BgA3zGrP1jy+V5zk70AatWJ15wqCBWWS0PGuZK8B7YFGUk+nAA+fENQqmuzfx2RgBN4wgbDkPJcjUNyDiY9I8Ekcnm8Bs4n1KRKCAAVWbxFakviHhU2K2sTtz+8Ufj9yg8Mq3PKC6CmW+7Dd5pjRteDsoLf9/LT64XVvlE6+ZeWF+Ttys3nX509aUnG5lmOmFIj0w== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4616.eurprd03.prod.outlook.com (2603:10a6:20b:e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22; Mon, 11 Oct 2021 15:32:12 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:32:12 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:31:56 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 X-TMN: [Xy5BVQgV47GJ4eKy3JsS2IUH/kNNb9ql] X-ClientProxiedBy: AS9PR06CA0142.eurprd06.prod.outlook.com (2603:10a6:20b:467::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153205.1960963-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AS9PR06CA0142.eurprd06.prod.outlook.com (2603:10a6:20b:467::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:32:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 07c3b5e9-b30a-4a74-1c82-08d98ccc4bb4 X-MS-Exchange-SLBlob-MailProps: EpEO96k6WomLR2JEIhXFxRYWdLpGyWrkBUUeFRpYLjnIcvWIDtfne86cPqaDGAVUlisvY/m3SM/8NP6ap9rRdyP3Dm6HHNG7u8+w+mSiJQ9uYgSlDLx1AVsKX9KXUbj0haR6bPwuum5YGd8ZxSqegv2t/hGz8eak7MaZHDpaqVQ1IUE4GquW26mV0bGBN2m5oiSBZ0SxYEkJZVxWdzaEp4wXdbJqNngm85INwZvZvHs+G/jqWBOekAbrZwsxp6QaVyZ0w/lPzwgGVQIpAwkemk+Publ2Nteq3xzVX0QyEnNWbzcy9RCmOBS5MUSC1Kx5QNpEEkEy7N2vL2YndcKmw0bWzx9hLQqnoM+JX7nMu75/kzqsfWgVsiWHQEaVMvcEx5auRx1o6NlwYBSg6O0bfNKjAcnrRXgcODze+T2g0F003AOFMav9jKrlGK7B+5yWUMRCHok78nHIkqsQCWQ3umHliaJ98A+YmNlrIR57r0av/XmePA48T6CIM6dGFzfpb7Wd2HB9gTBw0J0oiuRn99DBjC5Jclg1Vq/qB/Gnq3pzC3v6N0i8/MC91hdsOJj+SviWJHaWGbFVrcevMhr9gzO6sRl4buGGP0yysJXbnVNzrksXCSblwOF/aUH6J+JJu/yRhhuIjbYLJOmSQcM9SoRa5CLQ+RQnH1FIU+D8/5YCTwg14mkaFDp3bv1Jtq7jhZoAl7SMBNgHzFbhiVWgX1FFCMW+9i08OnH9x3lMoM7b/dyjsRGUP7c1eI1yXbRlQ48Rw+GIF9U= X-MS-TrafficTypeDiagnostic: AM6PR03MB4616: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RTaxZ9amJSVF9LEt3zrhuxe9DsgvLAfa/nLCfhRFbMoGy2PDaSy88HXFHHDqGezqbEx0Ub7q8IexU1Nlpfhjq/KyQFQFWRI5m0Jjo4xQcmINlf7UwyCUT5v9/W0M1li2wwBqX5tdudp2mMV7EkzMHSjNJEf+IZ9PE6SCZ7YJEzSkugwuJ3xzwnmLHlM7OQEBwTxSp8rewvNfC2NAGig4iPVFSFEfqxAlexHvfZgVPADtYhO1VW52kBKK4TIkKM3xAtyYK3W0lcZW0OiS9iK150YOjtpjGv2P9HUqaCf/QtI2uNkaK+0ubSU0SxBDf9L3SeQ3uD+GRiMDRIhC5gnPUuf+Mkl2wJD2n6aQDXrZ27UB+9WXdIy9nLG8Qc/G9RhmnysMRvq3NIPHW0S/S3jM9keSFyqzwqPJWbHcfnejtZjIquUdwp8EgLfOaFmN9lre X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KZ8NwyNj4woGpmCSJiMu6djmfBUvJHPrMRLmGMQa62zSQdnU8DTm7b10Jh8w9hTOmJuxbq14jG3yKnxjk8TVQZyZrZprpG1IlkV27aQTDD9gH507b0HceUtoNM6JW9aE6+TYaBStFpJALGFy8y29GA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07c3b5e9-b30a-4a74-1c82-08d98ccc4bb4 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:32:12.3277 (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: AM6PR03MB4616 Subject: [FFmpeg-devel] [PATCH 01/10] avcodec/binkaudio: Remove AV_CODEC_CAP_DELAY 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: t1g+pH6aMjSX This decoder may output multiple AVFrames for every AVPacket passed to it, but after it has returned AVERROR(EAGAIN), it is completely drained and there is no reason to flush it at the end with a NULL packet. Furthermore, there is also no delay in the common sense of the word. Signed-off-by: Andreas Rheinhardt --- libavcodec/binkaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index af8cb2809e..5915ba6ffb 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -346,7 +346,7 @@ const AVCodec ff_binkaudio_rdft_decoder = { .init = decode_init, .close = decode_end, .receive_frame = binkaudio_receive_frame, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; @@ -359,6 +359,6 @@ const AVCodec ff_binkaudio_dct_decoder = { .init = decode_init, .close = decode_end, .receive_frame = binkaudio_receive_frame, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, + .capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; From patchwork Mon Oct 11 15:36:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31063 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3821239ioa; Mon, 11 Oct 2021 08:37:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4bK8VLMVAlmkkg+Gl7tkaNx7YAX/4uSaj2AKfDy+VoA0dhcMiI9GcdFoQ5PeVxpnNkxbO X-Received: by 2002:a17:906:5e17:: with SMTP id n23mr26061384eju.258.1633966629438; Mon, 11 Oct 2021 08:37:09 -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 20si10314618edx.414.2021.10.11.08.37.08; Mon, 11 Oct 2021 08:37:09 -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="e/8C9Kew"; 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 BAA2A6801D3; Mon, 11 Oct 2021 18:37:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2051.outbound.protection.outlook.com [40.92.90.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0C8696801D3 for ; Mon, 11 Oct 2021 18:36:59 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kOvO4od6E2xRjQqqzwZQpunARWHIdR+DhPcqLtS5aqtL62BzrTAvbaiYnE3kjzI4vXDZFrSIT6dNAvN/+iENdQbSSHW/R1D6E5wMLV9NF7L54JXryN1fL9sMFijjTNI9vFdNGJY4t+rk3lXaBCqfXfyaEBI80TfKDcO+vKgUF6ujcgixbFoJbDJKF0Luq1L849OTKO1LEOm2m8RyrtgawEOFe5HFKNNzFT3HoICrlm2ldqEkxKsxktsNB2BPJiJcIr1O0qimTii/RHEuuWs+EpF7KmWKbBZvhbbcH7q0vMbqNbj444wBS1oz0s86cYP4WXVEpxQcbLLHMXDR38k7Bg== 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=p65g9sJ2vK/fLFx3ogwhmh14lDjdFLH/eqwWmw4g9l0=; b=Vp9gCqm81sIga9y8/i9K1LgQY1IDY5X4URykxodZ4gv6vXVAx0ZkiPBvZRmfu/JMbkX8ce0/Je5BY3pCPAwSirBy+8xcBliU06AXD9U7ywCogzSpNN7a0hGbu+2iuPyOHVfLO3VqokciVg+fP30LLvps2G4dAZ2haBvn8y2qRru/Bx6qswazzNx43sokS/CpCY/BJxDEoFTNpaTydOXJERCBe2hm+Aq68EzLzZLEHPUj63zm2f1tModv9dtbDz/ivpq/5FYN177sgPUhSAAG1acE/RwATNIkUQbtTVLJqMTiVfk7KL2hZVO1drVlgmw9DD0nY5psLChvf4xTPR4VWw== 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=p65g9sJ2vK/fLFx3ogwhmh14lDjdFLH/eqwWmw4g9l0=; b=e/8C9KewXj6SGcW6/4HPfgn+r7C7c92W58Xje4bL4PlEX2bUPkntsFtoPEgxug5Fn701u8tzkaz+PPwTe0uAUr6LW+MX/OlchKKTPRJZunuXcWtRkn+JCIHkflON8LBEMjrSGw7ZMNXCbqOlPjwuuEOqJ661TGD60G+20ycKLq4PcYu3n3Yj3vj+nyhefUASjeSMomt8rxkgoAoAZZmejsvcFe/1Nlg1u3xydVDbRnwJDnxAAD0ZhT1KjBRVh4JZVv4BARlifeJmMeHRl9Y7AO53ghCae7BHh0CtiMv/gDmVt5f6zEbjrg41dmkY5wyZ/3k0Awe/pdA2D1S7ArysFw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM5PR03MB2932.eurprd03.prod.outlook.com (2603:10a6:206:24::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.24; Mon, 11 Oct 2021 15:36:57 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:36:57 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:36:41 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [Dn79lSF516Y8iJPecrR1yfltswDbRgkz] X-ClientProxiedBy: AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153649.1961025-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:36:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33042c15-ec73-4401-426e-08d98cccf59e X-MS-Exchange-SLBlob-MailProps: f36zkjAOy3X3YFC7jPfP96qrOFzh32I/dH+HXYLoveRfAW8Vt+a7O+tfYwlwtixUbSTFxO6hnudNE0357t5MQvXXg0kFho+LShvSz3qZqSNbQzl7b97Erk6GQce26/cgFcUxKPMQDJRjjKfD+U2tvlHopE3Di70cdNimbWq3J9t6TtY+5epXa+Yxv2r9HR43rnmWFCX3N7DQNWZXyctJokbAw+oUDns8AHgz/4atYqqWfgDQ8bQZ5Fr9akUt//IMqjR/jVQOdum3MrJ/Vv+vuD3NgSK0k3WONCBiX+Y5/nPexZVFXqslhqz6pxuwAJWa6DKC2luNMVveYx75uIgYjNDTo9sCZw4L2bXN7fz0/pdA6DUk1NPh3G8f1TCujHFcEj94XyGCUnZtzXCxw6gwIlJ1UI3REB5nHycACwbLtyAYKqcjobvqtA4vJvJ9+dtXX6J3nyeIk6rK74B3to+xQHJb+ve7XKAyGqvz+r6WccST1PfeFybuNwsPycC/HHHxpP348ZeAhRkzbGsncbYXHOg/oHyCZJ4fx5EY77vWHinfbcXcAS99STSZPCky7Abl12LQux5/Svsre5gEEqXCVIJ1Hs5C7Wy7zDf0e7RlrsCN1xsA0TLDw+C7bNuQuPIld3o0XB11o0pVIDMF8yYh3bVafW8xVAPeKwg0uiEuWY9ApMCT5lJyQK/8d8xa+wrAtywst1S2fNrCno+Wr7o4WENhSi9wS+WL7WzgL5oJFfI= X-MS-TrafficTypeDiagnostic: AM5PR03MB2932: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WOZgqD/jWL0g3Q6lBQNRKEASVeuGS64xlJTWi8jrt3ymhFLzlyiWgaIt28nVLURaK3d6sCy2k9GuQmwVeZc/DRUMmb74o7GNCVDOaOGBpmCJVEppxc7Rhs5W7RDXg59SgkHQW1HsutkiH2cHmylzM3JRyz0Om/37jJ41V0au0+u2fl3VF1QsOf53CU520y1IShNt2/sMnjxgDnn8yb/pnSrUwHcvdUbevAwFy6wfJcGdvhxbCNup6Tb8yrcjXH4ORYAqlb9cjIXsBkrc0ToDzklkPe8m+YcgPHi7JzRSkx2MV05v6fA3I7O3wXp22wNApoG+uMA1Ol8YuPGaN06A774iqmbCAjBrCnKL2O1SDCJWpfCsL66uxbhTvapfIEnEBFlqiRe64xWiKaWgbNnsoMCTwM6RPAQHn8CcLWDkcqixRfsnk/Wz7sMGpaExSRzR X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TFL02cn9X2/G6tjy7RRXnnz6qBjY0Y+8ySaaMqGgPsYPMKv3yOeePPFXQHyoRsTN7XAwniKzmzX0lHyOnvjyL88rR+k1a+uRe4kGMpltmUJKv9dD6lP00l45AJf/tVilH4Xb4g5CPyUAnKAEF7Yh/A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33042c15-ec73-4401-426e-08d98cccf59e X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:36:57.4290 (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: AM5PR03MB2932 Subject: [FFmpeg-devel] [PATCH 02/10] avcodec/binkaudio: Properly flush the decoder 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: fzKYjSGZIO4F The packets delivered to this decoder are often decoded to more than one frame and if the internal buffer packet is not unreferenced, the decoder will still output frames derived from the old packet (from before the flush). Signed-off-by: Andreas Rheinhardt --- libavcodec/binkaudio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 5915ba6ffb..59ecab25c6 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -337,6 +337,14 @@ fail: return ret; } +static void decode_flush(AVCodecContext *avctx) +{ + BinkAudioContext *const s = avctx->priv_data; + + av_packet_unref(s->pkt); + s->first = 1; +} + const AVCodec ff_binkaudio_rdft_decoder = { .name = "binkaudio_rdft", .long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"), @@ -344,6 +352,7 @@ const AVCodec ff_binkaudio_rdft_decoder = { .id = AV_CODEC_ID_BINKAUDIO_RDFT, .priv_data_size = sizeof(BinkAudioContext), .init = decode_init, + .flush = decode_flush, .close = decode_end, .receive_frame = binkaudio_receive_frame, .capabilities = AV_CODEC_CAP_DR1, @@ -357,6 +366,7 @@ const AVCodec ff_binkaudio_dct_decoder = { .id = AV_CODEC_ID_BINKAUDIO_DCT, .priv_data_size = sizeof(BinkAudioContext), .init = decode_init, + .flush = decode_flush, .close = decode_end, .receive_frame = binkaudio_receive_frame, .capabilities = AV_CODEC_CAP_DR1, From patchwork Mon Oct 11 15:36:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31058 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3821658ioa; Mon, 11 Oct 2021 08:37:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxmpMO5DTTGg7dRrW7Ck9B6Fccf+H8ZqmcvyV0CdtfVBjJAUvXUEjofZzAC7iy3Jpaf+S1 X-Received: by 2002:a50:9347:: with SMTP id n7mr41110336eda.249.1633966649994; Mon, 11 Oct 2021 08:37:29 -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 l7si2052586ejn.77.2021.10.11.08.37.29; Mon, 11 Oct 2021 08:37:29 -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=kjM2RJ8e; 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 AC792687F4A; Mon, 11 Oct 2021 18:37:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2051.outbound.protection.outlook.com [40.92.90.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 292D2687F4A for ; Mon, 11 Oct 2021 18:37:04 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f/va+RptOZVl8m/S60wCwbiIu2T7u0cTc9bI0LLuAt9/pX13fsKRUGxoE4ffKLEU3sYMfJQongd70IetJaK1Rg9RTMojrP1qrTqwc4NdidpFtv7tqsz+8f2luN+v2f811KMQuSJWFCG03IEtFfJcIo+iVeYYfJNeb7g4qynm7hYhVarjc9YMxaWyik+DmX+zyGFhSNPbHwXi/osFXd89KNGxKP50AVVU4ACGjQikg7nngV779hl3di/bkPq71jxbHT2VauYVpzhnAFa4FL8EdktMEhmL5NdU8hpdKhfcXOOlPHpuW2O8sWw8/vXeMEBTcfMvsfRELjoaTjcq1eAs1w== 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=ySyjwGLPdOP/ETQGOaP290qb8uKx3XREmBs4EGzJnJA=; b=YlsLWDNPfyfHwd/DKq/59bG+cDGVmh4AfGA/qQ+C2BwsuGay0GcvkbSBN4VIFPCKKyFi6pGFurwALnLaEtBSDL26306rrw3q3AAvqeCXDDmKV9RUICEh2f3gW2OvHoVq0u96HFW1I/WomP7eIcK9q88t7qUDkVjlLTXHMLD0bU/OTWXhnCSw4WBPJjYG2q0O7lgCUjL6QbIWF7bUWo+ew3eDUazd63OYpMdZajfomCfuHORmI2fExJPnjD9zKWvzpGHFUcsGVuDPsfDo84dZX+mddpqr3DGTlEWK4jo+6ArqsFbKwyqrf7xv2doVh0rgNzBZ/otfiypIqHkZkgssRg== 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=ySyjwGLPdOP/ETQGOaP290qb8uKx3XREmBs4EGzJnJA=; b=kjM2RJ8eBZoOBsr2f+71ybEnR/4D15YEYeCMomelae0JL7o3Vd+fpVgqlzd4YDu9SIx0eJRtS8qAPQP2LZsFdNhhsstMSxSOmxyegbzLE8E1HpIaJv9BDTxGhTnRph8qkCSA0FD8WERMNA03fuLPrl4MqzZKJeE5mvAlZKebX5KTeEubTFUhb0VK4lCOQj/oSZ2t8pImuoMULmc5cigOGIFtRzx9QsnAx7JV7XL/+7m5lDyldoK6xH6bth5KV+OzWi+5hA9mbX5UF/OjZq0B2KYg8uKUaX9LqQWjhRa9UaSA6hQVw22185OOlyIhImTfHWp4jMZHQ+0DGqBSKzTWpQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM5PR03MB2932.eurprd03.prod.outlook.com (2603:10a6:206:24::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.24; Mon, 11 Oct 2021 15:36:58 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:36:58 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:36:42 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [f+Sio6Dl4m+1+qJab2VPYaDapni3Jblb] X-ClientProxiedBy: AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153649.1961025-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:36:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e4111dfd-d18e-41aa-ceb2-08d98cccf653 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiS6+TXmMYPOjHmO66YJyNLlhhlG4ZCOycODT0BkXsYaclVuxvZLfpSncpFBvBhYaRIYuqRKJg6pAVw8HBkqVPG1ThY4SDJBAE3BktxR42VQDu0ELyfBn11t8kO6hyvWgjxIXvyKu4NV3TNf/VWntjS+Y9lwDbVTbLMv3DzSaL3kxps5+zllqSqdIPjOXN+BQsFUq3pquaOicHxpVEtVhEtpKksDMfKb1RL33tZyH1OpfWU9PKLjcre8H5+zV3pB4zN+0KWrjEN/sCXRR0JiRaB4XJpq3UVkc5BONrUpgiwmC/6ZOQ0tYaBIPyydD3fYF6OO89ff799H4ueYHtQg+p9obqOpe0DhqRey6QjK+rpiIuRagXng4Z19RBGHvpSjeUL+KJ2CRrDOaJwKSq+RGgfiNlDUaUm2nkMpXsN493XLCu9yS/00hobUlnBkCCl2vTtJ/uuxiLzzILstuRzQrZlsa2U4aDXsl9HiYQX5KCvqg9yd5I/IshoI2NiGY9pvcYr+i1Potpw6ulQYTL2wJCyuu0ChBCcbk+IouPE69R3k2+nrlVLTDlL63GKPzyBTvPaw+GVtJlCQ3ywS9AUzKYrOA8x1Dhk8WBQZ7PZ7t1QeBLXWqNbjCSD8YGUt0LVn7CvldhJFZkIuV+LV6uRWe6aKbovuY88DjrFgz8GxZgdAjP4C6BYIkWzdJ3FY6CJhh7PXOqjALlKY0JKioArllVWDrHDhvBhoS63TzPE+RADJsemz5qWSXz/1TN3/Lj3zfBI= X-MS-TrafficTypeDiagnostic: AM5PR03MB2932: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uco+/ZWKBYYNjGe4QT9DDahux9SggdjFo1TJFTMr1ehEModkNRPuF+yzF/vvByc86GsnuXN83KVxaeyTkGC7ilRJcoq70JgqWKNNx8H1A6o30mfZDF1VEM1ozijvPs5yn0eqspevrU082BVZTHTi6E95HY+207Z0LD3+iNRT1EED/S2mUjLnmBGtz07mxoj3b2Bay8/dUHLtmyqcTtjnH2YscCgveO6y8aGLJCMMt9/fRNygJwX7Q9w/SMXtCYrDKSbNbfyIKIk4DFJh9SrFa4X7RF07VRff7SHHjW5wwPq86NcSVv4OUpCS+NmS0OgAWtIngTRHbsECXqkppirPjT1CufpsTrJ3jfNe0uaeoBb4iUWNb8xuXd4yfexc/CdTVErhu1jT8Vyz2032b+fq8bP/yrVWJ+xlH1QJ+QHd4+etVqg6b7HcOPhlJ6cgNjNb X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VqQzoj70jsakeL/vxA8QFqzTjbKNMZxpYvgwV/WNVof8hEuoILKy9jG8R4p9miNKmeaDHgT7tsxeuMV/KC8/fdsQJQ2C6aWecGGcF4XGurOu8sd3rEy/34KprKOMVQ+CKgPXMLzMFVEWBM5bTlWVlg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4111dfd-d18e-41aa-ceb2-08d98cccf653 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:36:58.5531 (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: AM5PR03MB2932 Subject: [FFmpeg-devel] [PATCH 03/10] avcodec/internal: Allow receive_frame codecs to use decode_simple pkt 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: DhzzkdjnH8JX Decoders implementing the receive_frame API currently mostly use stack packets to temporarily hold the packet they receive from ff_decode_get_packet(). This role directly parallels the role of in_pkt, the spare packet used in decode_simple_internal for the decoders implementing the traditional decoding API. Said packet is unused by the generic code for the decoders implementing the receive_frame API, so allow them to use it to fulfill the function it already fulfills for the traditional API for both APIs. There is only one caveat in this: The packet is automatically unreferenced in avcodec_flush_buffers(). But this is actually positive as it means the decoders don't have to do this themselves (in case the packet is preserved between receive_frame calls). Signed-off-by: Andreas Rheinhardt --- libavcodec/avcodec.c | 8 ++++---- libavcodec/decode.c | 3 +-- libavcodec/internal.h | 14 +++++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index ff3d73e237..c00a9b2af8 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -181,11 +181,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code avci->buffer_frame = av_frame_alloc(); avci->buffer_pkt = av_packet_alloc(); avci->es.in_frame = av_frame_alloc(); - avci->ds.in_pkt = av_packet_alloc(); + avci->in_pkt = av_packet_alloc(); avci->last_pkt_props = av_packet_alloc(); avci->pkt_props = av_fifo_alloc(sizeof(*avci->last_pkt_props)); if (!avci->buffer_frame || !avci->buffer_pkt || - !avci->es.in_frame || !avci->ds.in_pkt || + !avci->es.in_frame || !avci->in_pkt || !avci->last_pkt_props || !avci->pkt_props) { ret = AVERROR(ENOMEM); goto free_and_end; @@ -408,7 +408,7 @@ void avcodec_flush_buffers(AVCodecContext *avctx) av_fifo_reset(avci->pkt_props); av_frame_unref(avci->es.in_frame); - av_packet_unref(avci->ds.in_pkt); + av_packet_unref(avci->in_pkt); if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) ff_thread_flush(avctx); @@ -473,7 +473,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) } av_packet_free(&avci->last_pkt_props); - av_packet_free(&avci->ds.in_pkt); + av_packet_free(&avci->in_pkt); av_frame_free(&avci->es.in_frame); av_buffer_unref(&avci->pool); diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 294c040716..c44724d150 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -296,8 +296,7 @@ static int64_t guess_correct_pts(AVCodecContext *ctx, static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, int64_t *discarded_samples) { AVCodecInternal *avci = avctx->internal; - DecodeSimpleContext *ds = &avci->ds; - AVPacket *pkt = ds->in_pkt; + AVPacket *const pkt = avci->in_pkt; int got_frame, actual_got_frame; int ret; diff --git a/libavcodec/internal.h b/libavcodec/internal.h index b6180f15a5..a62f8dbd4e 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -112,10 +112,6 @@ # define STRIDE_ALIGN 8 #endif -typedef struct DecodeSimpleContext { - AVPacket *in_pkt; -} DecodeSimpleContext; - typedef struct EncodeSimpleContext { AVFrame *in_frame; } EncodeSimpleContext; @@ -137,7 +133,15 @@ typedef struct AVCodecInternal { void *thread_ctx; - DecodeSimpleContext ds; + /** + * This packet is used to hold the packet given to decoders + * implementing the .decode API; it is unused by the generic + * code for decoders implementing the .receive_frame API and + * may be freely used (but not freed) by them with the caveat + * that the packet will be unreferenced generically in + * avcodec_flush_buffers(). + */ + AVPacket *in_pkt; AVBSFContext *bsf; /** From patchwork Mon Oct 11 15:36:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31064 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3822053ioa; Mon, 11 Oct 2021 08:37:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuV7F1/2BZMUw1H+cOIKXy6wIXSXd74QNfxfUwErHBZUNkh0fIf1Aah9qoQEaxT3EnsEP6 X-Received: by 2002:a17:906:4e89:: with SMTP id v9mr19404699eju.354.1633966673131; Mon, 11 Oct 2021 08:37:53 -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 m10si12200756ejb.115.2021.10.11.08.37.52; Mon, 11 Oct 2021 08:37:53 -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=kSjfKRnU; 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 D3B5D68A905; Mon, 11 Oct 2021 18:37:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2051.outbound.protection.outlook.com [40.92.90.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F7BD68A8E7 for ; Mon, 11 Oct 2021 18:37:09 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=of72POZmE4oFtn0mX+CNAAIqctwGzRIxfuccXRw7fQCTNXZu5vAsTsEP8dPZjx4LSYX5k+yWeru70k3etnjJzToxraAMWGEtDD4AM18VuUWbO0p8TuWfSuAowzoHsItrkILxseNMJc6z9pXRqWqQYbj7cdEbijWk0byY0c4szfq78tKdi1v4DlW8f5RY3Nw7L4aK3maXOwIpXYyFQFFNXsjU3vUDEUJD5iZtxYBL4R/hOfC6cDsC6Qzd4EsFkWzwm3FFpJ0IWyWeJS/QJcO+8zbx4J8kzTmEuJxE7RQv+ukmUnLfnUoa/eud8bT3WkMJxN11SzvA/iTHEukM+MuKTQ== 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=JC7mTYrXiyUA08Quhvupmx40B0hDLx506grsCYAH+nU=; b=kePghn414CfI1P+UAQJdm8AfNCvYnHmOB3o7JL9GvhO0AfzpP7txkqXCZWxwlbLd8Zgpe80WPN1ESiWWrFiaAUabzowfSrzvSClg+kjvsAJ9YcgKweGyZKYO0OtFP089q/C1vvu/+TamiVhGY1Mgg6W4f2A6y8Ji9AIS3wbWUjiq6A3vp4wBX9WyTECiD6frRCNeXITtbrV+G0xlN+X0Zxf391/Hz1WKM6f50XzMK78P1TwjkKwj4hvaHyr+rkM0Lmlq0U+pXID4EE0fN2FmJOUlEeaN3ZKi8c9cJehBgfV8s6iyNj1P4xbZssh6YN4XNgQVbva+xpG0pj0RNED1tA== 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=JC7mTYrXiyUA08Quhvupmx40B0hDLx506grsCYAH+nU=; b=kSjfKRnUvsaODKKu4T2EGnVtj4Q3s3TnFuy0R5v2X7bLluEdsxwgxGZYAoaFeHA7ZlPEYuUnw9bM/zWdvu9CYt1iOa1IszwaPx3jVYA8TEWKqm/b9MDAYZNR6GGlBgkY6IM4YG2JYihjNoDPPvjGaGbhPKMNVLPehif+3W6GBDHKQIwMvrOTjlOtMpz8tOBGNdxlpf8MswWF2IyMQ7dhEgUneFKRtG0WbogYFGiGhv2VOTKYHJElOBEt/8Gahe2S+r1RG+R2GRkB7yJqNgi6Zn2SWSgCx8ukR4IKoyXZtFjx4AaV/19OU5D/F/zREKrxcEJ7bgC0zO5bMo5CS6l1LA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM5PR03MB2932.eurprd03.prod.outlook.com (2603:10a6:206:24::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.24; Mon, 11 Oct 2021 15:36:59 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:36:59 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:36:43 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [8qZomQJ2v7HxB47leVC7tCp7lyWuarEm] X-ClientProxiedBy: AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153649.1961025-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:36:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a5b66b5c-f05a-4536-6cb3-08d98cccf6df X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiS6+TXmMYPOjHmO66YJyNLlmzJSMdLPd6or2N5t/VAQraDZdI4Bgx+WFZ3/HWRAiUtFLp2JVLViVgckDVQ/jR/nYNm9RZXgRepddInPvvCD3YXkNlT11izcW1ay228urZNbWzvLv1n8UpM5a0Hircx/qqMrbnDDak+n2t+StSLeFTPjjhqhVlcTW9Nt1w4SA8CMUfx+DF0QPZTaFZr1NfjmyjoZC9Ze8ae9JpkLkxRQjV+/u/EIMbemmrnDOeXWdjq5kF1910NTKyTfiDT+FgGiD2SCcdkTijWHlKjz9bMrm4eYbdZq4OhwExCreO1amiJlulyyymAKwSIkLjDcdanlzpAm5BTUPzw1TXHT2QFQkrZ+gUFybychQIkqkSBxz9qVr+sDanRdhcB/sos1SjEbiCLEPU4UEHEnoEacUX68wPYWCzFr5bt+0X7ffFrw83fuPvop8/jLuPFTi22zinZkuP4UuuzgFN6ILTvA/xwxXZyaPFifAl3ukT9GI90NvJu+E3Bqdtc7AKty7BLdS1r16OHZ09O4hDme0lE4A0HB1KFoCxK6CZOOIghAHsbycGDOKB23hORwoGpRG/kY+lemoJGBbBpAiBoRHoLbf1kKnGcc+koKpVpoqg3X0HtndCQ5EWWdHAbq7lQ4U4nb1TThkmeZTypZLSoVc4P/Fdhru39UOFgucSb34UCPvVrUz8+zZhT2Fr7K7ovhRFxrTFRNz2D0T4I6kZMA8xnSJUE6MIcAAORyQGgwN/++3oB6aSc= X-MS-TrafficTypeDiagnostic: AM5PR03MB2932: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YnwIJWnYhIEN5fvfeGRC5V9awog3zBdyuzM6cGhFsCOFmMJosig8i+9K7daIUAW1fN6Bj+lKEQs20hZZ7RMHEcjh4kYxqnDLumkBK1+a1lnyc3kfZ+J34kvYSDOvFsUHfOEljDZPpGj5mwVzZyq0abEBFqp8Haeux+2XJCkatv5xqL2gP1EvB1b7MPcgfaRZXD4pzOzDItE4/VgPvt11x0l4KEYeTtdlTds1HIhFZlXVnS9/rBRZseMX4NQ+MDNPF5S9uSL8CwlJPaxQpexSO/5u4+UxvxJ/6XXwpMOccg0QoMrxOP/Nt0u9jm5iARWKITHudRGHOO5Z2AQLzUpsXOVipQvOKXHjgk7BaoYhDA4Fc07SwEM/iNb/cUoLTHSlqm4cW86rOHhduYogdXyJO54r/5WLWxFBbgzNkC5JSJi9RVGLnSQ7xnvhGJJflORa X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D7w5GtZITMUQR3KPhcZ4IrygOwg45Z4cqXCcTJFBbWFqVSWzYbrW9H7S9ye1QXtLK74siWO75YV1tP6g92J/xHfxn9zqUUIy8F+UbRlOKSr60elW/eEpZIPzAw0Em/g8RnmrbNzmSQdGO36EVwhLSg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5b66b5c-f05a-4536-6cb3-08d98cccf6df X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:36:59.4930 (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: AM5PR03MB2932 Subject: [FFmpeg-devel] [PATCH 04/10] avcodec/binkaudio: Use AVCodecInternal.in_pkt for buffer packet 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: siQ094tGEmIc Signed-off-by: Andreas Rheinhardt --- libavcodec/binkaudio.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 59ecab25c6..f808141ba5 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -140,9 +140,7 @@ static av_cold int decode_init(AVCodecContext *avctx) if (ret < 0) return ret; - s->pkt = av_packet_alloc(); - if (!s->pkt) - return AVERROR(ENOMEM); + s->pkt = avctx->internal->in_pkt; return 0; } @@ -277,8 +275,6 @@ static av_cold int decode_end(AVCodecContext *avctx) else if (CONFIG_BINKAUDIO_DCT_DECODER) ff_dct_end(&s->trans.dct); - av_packet_free(&s->pkt); - return 0; } @@ -341,7 +337,8 @@ static void decode_flush(AVCodecContext *avctx) { BinkAudioContext *const s = avctx->priv_data; - av_packet_unref(s->pkt); + /* s->pkt coincides with avctx->internal->in_pkt + * and is unreferenced generically when flushing. */ s->first = 1; } From patchwork Mon Oct 11 15:36:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31057 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3821463ioa; Mon, 11 Oct 2021 08:37:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMb1Ri1wLO11XyNa/120/DWpGABulHPv1d2fpE+bZECZV1uW6J93DfCdKBMsDr+jy1HDSR X-Received: by 2002:a17:906:3990:: with SMTP id h16mr5126082eje.47.1633966639994; Mon, 11 Oct 2021 08:37:19 -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 z2si12057171ejo.651.2021.10.11.08.37.19; Mon, 11 Oct 2021 08:37:19 -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=EWXcfXI3; 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 B002668A8CD; Mon, 11 Oct 2021 18:37:08 +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-am6eur05olkn2075.outbound.protection.outlook.com [40.92.91.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0B55F689E7C for ; Mon, 11 Oct 2021 18:37:02 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lJ0c1EK159JZEMsff5EtXdY3b1AcL1YQmVsNAVK+n5yP28Bl2uJebR5qCLboe+bLSSzCQvYdz70HmztgchiuxB64AeuZ1LGR4JMOF6OFrrXEHiZ9RRQXrSn9cEATiedTc6Lb5/IB8YDSZzYzAMMPW0nI15/VSikTpuAhaClEdE+ZjqL1QvwxdGNoIGuvOIyVTyrjG8xWst0JtaW4tWUpKsOExsOAJ4B4FAckWYwu/9HaVfaSdfbuyAdtPH0vVcormLPkvd09Co9lwsxO37z5A4TZqtMDzlgjnQUM2exJSFMNLJ0kfx96iZ937/b70mJHML3VOod7ZU9SxmCPjahCnw== 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=LQI6PCpyQ5RNNgwHX/BuhJttHTgZFIF2lYz2GQbSrJk=; b=TRs8VOBOzL4cPSCAptcGduDUgGDSZIOD6uuAQuXGSv7Mhg/WQvgKDty7mjhq8b3gdULNWW9U7uo3UECxW5OSFwDx1WFYnh1ch58LliRRoPCMWX9Qo6EUh96jJgItJPtr6wyw0UX2FdRHOGDA+EXODyr24Vg97n8vcbsTSxCpKejOGeLPtitqcVPo04w7NXWNOo6GzGP2dfjovl185t9ELuiQ/JHLile9PatrbsaY5x6SeNuNTOiBc3VK5VkCX4wwgDcsGvgvpvsVpoWPMc8yqZ1a6isnkGF/s0KkdAVg/0t5+3eyI0yTwg9XTJCWuckfiOi6EZV5ap6aJQUeYdkTAQ== 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=LQI6PCpyQ5RNNgwHX/BuhJttHTgZFIF2lYz2GQbSrJk=; b=EWXcfXI3Gt0/HT0aCXykwfZJ03xsvJZrRXBOfdv7dcQqyYDJmW+N8gX+zsl9Y+ziabb/N5S79aW0VTf0fweUB01tJSJZtHVpcxeM5DdeQ1oOQhS6ZKfCKnMkW0RqMH0ANMQk0m+1XsHYudQRVMYnLolRrsH3sPfxbV/a+OBWxcqwsQKXwmtWXtj0KBGLxo0sQePfnuaiopMHu7mRaiYWq03C9pJN5qIegQ1cxy5ZGxWA2bykSH3hrRF+34imXBnyl9AbStUxlE3DRiWoQJ7qb+GfFA0ENYxtvI/CWiGnwF9NGrccsTgQsSa316ywaAoSAcGNtVcs0RT53lgrsVWgIw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5046.eurprd03.prod.outlook.com (2603:10a6:20b:88::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 15:37:00 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:37:00 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:36:44 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [yNwd7VoB2AGJkXePCJSNc4iWhrSiGeln] X-ClientProxiedBy: AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153649.1961025-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:36:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 462cbe2f-aab7-4cf6-f9fd-08d98cccf75d X-MS-Exchange-SLBlob-MailProps: +LiGfBxqLEuXvjPRxFEFEnb/PQXfcGTfszCDiFaULQcvi+gmNeuU2KQMj0LsKd9OBKSychKUU5tKvorq+6QeIUaZuehoEkkLn6hh4NXBNPMNn9/rYRobq7gZ3NZoz9Mih5nHqEYAfjLHYGtH715fLOJvWxJp09hE6PNTP+EE4ny8cx5YAcRWYl7vaego7sOwsNKA1o3+/I6IzCZsjLV0URhH031BaNg13wPJkrCnOrDTCssEKbnwxYKb4NKAuqdslgC+8gYq8NG37tN8R4zJCQ+JiB2OywyirNF+S6bkRRZFpFyeigTmOm1IuFGxamIUMiBVw9HaAVV+pv1+KZASuvMV0DLTWmGu99lEHdmD6jeMBHTNCdzs01dG4exUI5YVSZ5vAtDXAVwGUTIq1Rz5BQiWC2AhFEp2d72d+cmkDdsJFbFWDNIs3HTQNTRyW96oejpKXXxDPGJutPT8im+rths7Ly2EWW7RAp+A8dgSfccMMPY1lPZnt8pXyeF2qpeNgHRdJSLKqnwCJywaHTI1OqVY0UwnMm2r/fFcuQjQP3taM+UkJyJI3DUg8K5F9KcButWWsY1X8ALIXoKeHVYfgpqXFI0G2jghpPLMasPtMyPOXj7rNN9GPc7Bl/G+GBlo6gb9aU3JekXdrjCoiwA7Wex62jbthrSLvoM+OWTSmHjvafg8rAo0gej0ovIl8DnKjlBSmrpSwpWEG1aPfokLfCJ+i+v5dx2Tc7N3JP8aGf9/nu5dgrE/ncg0q+JKjYQlq4hWF18hvBToJZU0sWyVLvfEoUAZqngD X-MS-TrafficTypeDiagnostic: AM6PR03MB5046: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 23uWUh6GKvYCWX95D3i7o69HxI0DFiZaPhEZUcS0uBRkUog5DFKvIKS7TfZAykKouYgKkqNUyg6C1Utrf/4pA25l1+0WKen0CJFZdrYcXbelpQHJzNq/LReIfFnW3Hn6kWZey11yHR52SalezfFozZuMVln6FR00s5E1QvGNVPKKbvO2oT1pgLBp2Mt/tDLBOu8+n1RxlSMofc1t/xrf+TskgZQXrx5YA1kgm7Ub5N5xqBGEoruWn2T5BnYI58rQwSdoDPHf2mj9GCgiu208CAYmcj45YXmrvAkPrLEAcqApxuSVTlo4tawkdlia8uLZXD3yq07j0Tg/saJ8ZzfKO3F/OxW9C/RRppLA1zIl3wGeVYuKifYTAmT7GKCmHIuem/+EXAvgvSACzAGuW5AIXa1IXd6f00z9MO/rm7iZctoDfqdx4a+sWPnGVhagd8Nv X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N5+m2LyAhSJpW5INOG5jkRzXh/ShR3C98JrUZvivCf5NtTAoNfSPjUkoZvj7ppiHQ43pRyYNPN30K3Dc44eEVCtRDiPbrHngxWvq0etdEylaha1KvKu2EEh/Kgk4Yps+YnpYY/C2LeuYsOMuu98LRg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 462cbe2f-aab7-4cf6-f9fd-08d98cccf75d X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:37:00.7336 (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: AM6PR03MB5046 Subject: [FFmpeg-devel] [PATCH 05/10] avcodec/crystalhd: Use AVCodecInternal.in_pkt instead of stack packet 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: rvgBKBq45UQm Signed-off-by: Andreas Rheinhardt --- libavcodec/crystalhd.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index 0238ab7378..9202a16a77 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -90,6 +90,9 @@ typedef struct OpaqueList { typedef struct { AVClass *av_class; AVCodecContext *avctx; + /* This packet coincides with AVCodecInternal.in_pkt + * and is not owned by us. */ + AVPacket *pkt; HANDLE dev; uint8_t is_70012; @@ -328,6 +331,7 @@ static av_cold int init(AVCodecContext *avctx) /* Initialize the library */ priv = avctx->priv_data; priv->avctx = avctx; + priv->pkt = avctx->internal->in_pkt; priv->draining = 0; subtype = id2subtype(priv, avctx->codec->id); @@ -703,19 +707,19 @@ static int crystalhd_receive_frame(AVCodecContext *avctx, AVFrame *frame) BC_DTS_STATUS decoder_status = { 0, }; CopyRet rec_ret; CHDContext *priv = avctx->priv_data; + AVPacket *const pkt = priv->pkt; HANDLE dev = priv->dev; int got_frame = 0; int ret = 0; - AVPacket pkt = {0}; av_log(avctx, AV_LOG_VERBOSE, "CrystalHD: receive_frame\n"); - ret = ff_decode_get_packet(avctx, &pkt); + ret = ff_decode_get_packet(avctx, pkt); if (ret < 0 && ret != AVERROR_EOF) { return ret; } - while (pkt.size > DtsTxFreeSize(dev)) { + while (pkt->size > DtsTxFreeSize(dev)) { /* * Block until there is space in the buffer for the next packet. * We assume that the hardware will make forward progress at this @@ -724,8 +728,8 @@ static int crystalhd_receive_frame(AVCodecContext *avctx, AVFrame *frame) av_log(avctx, AV_LOG_TRACE, "CrystalHD: Waiting for space in input buffer\n"); } - ret = crystalhd_decode_packet(avctx, &pkt); - av_packet_unref(&pkt); + ret = crystalhd_decode_packet(avctx, pkt); + av_packet_unref(pkt); // crystalhd_is_buffer_full() should avoid this. if (ret == AVERROR(EAGAIN)) { ret = AVERROR_EXTERNAL; From patchwork Mon Oct 11 15:36:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31060 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3821860ioa; Mon, 11 Oct 2021 08:37:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCfaXXHK6M0t14snKLhcIbve/8Htz+nlowXIFrWlQY8exEqqoeQmBaO5pxU7GeVdM0ogCz X-Received: by 2002:a05:6402:350c:: with SMTP id b12mr42684993edd.244.1633966661437; Mon, 11 Oct 2021 08:37:41 -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 bi21si11700534edb.618.2021.10.11.08.37.41; Mon, 11 Oct 2021 08:37:41 -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=cFD5YYfK; 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 C4E3768A8F5; Mon, 11 Oct 2021 18:37:13 +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-am6eur05olkn2075.outbound.protection.outlook.com [40.92.91.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 223CF68A8DB for ; Mon, 11 Oct 2021 18:37:07 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NfA7vxN8+cVmhhCNKf6Op6YNRSvIP6bVl2MAgBJJZXS6vffOlK13AVPqPWccPhwimokNG9E7SyIWx6CF5QoyRBFdJ6goIOZg+ibGYrjkG4ag2gd97wg6X2eOPq/PIHC26DIPecKUqIctdCb8LdJUuqKzEMegIL1VdCY1Ggen1IUoK1JUUuKC6uovaB3j5UiYjUKWHsC1LCgXztFNQ3GzbVq6Rn3mPdhk0qT1TYUaBntjJeORoBfTf8bjlib76uwVBOhvhqw6AKtPLFlNHqd+40OQmbCkF9hvXYs4Ax1pMZmYWNGDOIcYXPGO27/ro8ntywxzDyAguwEojIARk8DGuQ== 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=cjZvMZgydJbkS3nxiRXqqBbRgnwkPe7BEFbaPMkvKOE=; b=YoKmPbg2IoMaNt+EvPL6EwBckmgA+Psr6D0RY87EMi+sL/xsNeiSl8nzDBif/gVnu9ZOi2BXp78LyL7TK2ssnrgC4udEP3moq9TSObKnlrI1qU7xA9DuJerkWTMGaiv4js8R5IMvepVrI+33wmHlLpFrZdQoDCsmfAJkpytKN9c6WBSjuQIlfjb21t71G+xxZfIg+ByyrfZ9b8NMt6ycIElsdNlUk7nsunLHJGMT6fMdfeai6dF4HW+mEOd/d22SQ70b2TDCzPl/lJvN417lAZs+lxdS/vaipRRvTcAprdIKPLmSreSYpj0Vvy99raM1os3LGx6ev+r77lvnS/v8oA== 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=cjZvMZgydJbkS3nxiRXqqBbRgnwkPe7BEFbaPMkvKOE=; b=cFD5YYfKOR+lPppu8UZ4k2/4C52pKh1Q5Q7a8QIkzxdD4hTfJkje3C7mQNb9yixheSlO1wsnFElvHzFtHxV903mvIzwTgXS7iZOI/oy9sFbPg7NHWntKU0B2c8rP/KXgFTHPJJYIYb7reTovCL/F6sgcU7eDEEeNK4GQ2RWIdvP9lZriejrjPs0f8be7eCGb6GJFrVJ0Idnp/fBrIf85RD6LigDal5ruzo5b6Jj3xB5WYNyuElJ8hOivL7t0gL7uzBcgSH7EASGdAWAxqcGh3Ey0c04ilnwJzicSajCz3i9RKMZz2w2CFb6wsdtsjPeZ7hdc/ug6Ou/gvx9vGzVU6A== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5046.eurprd03.prod.outlook.com (2603:10a6:20b:88::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 15:37:01 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:37:01 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:36:45 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [1IwAxCJ0kLHOeaWEQHESQgyXC8lqhZuB] X-ClientProxiedBy: AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153649.1961025-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:37:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58501930-044e-4622-69c0-08d98cccf822 X-MS-Exchange-SLBlob-MailProps: +LiGfBxqLEuXvjPRxFEFEnb/PQXfcGTfszCDiFaULQcvi+gmNeuU2KQMj0LsKd9OBKSychKUU5uR1MzZFiGfTPjGymPrgn71WUtMjpsKSnUYoLY/Sw+lTcbJsX1lgvuHk4mK4fVFBgkSFSLBaJNY9DXekyyIQGhq/BK+pyIXLnLKGED0wdI4LzvNNrsFDJMVtunQyNEwdi3GEPVfSCm1T/J3zr1tQB7+O3tO4BKZNNAVtUDXbzOXX8IDhPpMux7E4xjr/m9/Q/a2i54H+97s7bC0eb2yXZRA3a6ihJnrupxsi+G6cOjiDCvVXH1L/6i8YbsldY4GdRJP6mzDrLv8IH4Pwv/9bCeR5NK4kmK2vIBOWkMd1dP8W4aMVbdgBvTGs3BPfi1Ny58Km0o5S9H1sb//vSdrGuSUxnOf2raV0Epkw+LcUdSY88SOv7U3zWGBq1k+B8XwuQBsv4dVKv6pr2MTn53CdXp7m61MWdpqXfYwLVgIt2Gc35bmd3crsd30rjA/aMTit8EvLndhN/cD4ehhZFF/p/KwHdUJdZgAshcskTOPdJ8iSEEbf9uYEtqiu9ubh2zVlJLW7r6ufsSe3QHooNZKe2Ow1PLvu4uRXg387Z8vpMvFy+UT3UJi4wh6GULapJMxdGfE82/ua/FqUEd/smYxYGiJJN2warTKjNO+jUCh77rMrD1iGeQ/tnbGTRKuvB7hPx/DwQWoq4unAOGa4CCEfNxwzrAymRTMBuO/usue13DnoxJkCOKNPK755btN37dlAtmc9NCB35KpnfCnllLMtVEF X-MS-TrafficTypeDiagnostic: AM6PR03MB5046: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UcDK0eDmm7m1iqcpVvo+BKfOrnpBsn30acdAQhZv4I9JCU9CnDJm0pRcNk0wLvvfm/oUViEycJpxECeyQEOE0EB2nB3WFkGkeS404VG8CmGO2bXjf5JvXKX5M0/Pd4CsNXPj2q+pgFYUQ97Nx7mViHlWjn6MHlywCNFLpTrTkd9vCbdZh2YEz4VHdgnuL//isavz53GlETT5Htc8YtTuGKNhPKD5SvammYycIaKrs5oxoJKQfjvpifEzFmTF/4KIYUtziWMZInjmVyxoAMWtmYNoDUhSXuTsgUOpq4n3BXqU18sM17RqiYk4JdHgq3f1DNKlIB5cGAwJuuOHc41V4AXnlQiq53c+AaZTF5i+EkDW/zfepCDuKg++yN1BJUKG5oNUzez4wnzbLpAXzaf9Fc/MshZNnqQkZvuDKCHerSFW1hMK7ku0TRumAtYJT/Vz X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BHKZlL94eMIZLBLNVV1tFl6EdmJEiYKmnyOBOg69vWi+3U4z3nbOK8lXaONyez7PwdOpt7Sr+fJiOa24xSEDfFEgK7fbKguwQ68arO5Lg1UtZmxWBPFQK7ISTzEzB6FdgLZ4SHC6Eh7g+yVgIs82+g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58501930-044e-4622-69c0-08d98cccf822 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:37:01.7312 (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: AM6PR03MB5046 Subject: [FFmpeg-devel] [PATCH 06/10] avcodec/cuviddec: Use AVCodecInternal.in_pkt instead of stack packet 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: s8fhrdCRlcFV Signed-off-by: Andreas Rheinhardt --- libavcodec/cuviddec.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index e157777c51..f03bbd8c4b 100644 --- a/libavcodec/cuviddec.c +++ b/libavcodec/cuviddec.c @@ -53,6 +53,10 @@ typedef struct CuvidContext CUvideodecoder cudecoder; CUvideoparser cuparser; + /* This packet coincides with AVCodecInternal.in_pkt + * and is not owned by us. */ + AVPacket *pkt; + char *cu_gpu; int nb_surfaces; int drop_second_field; @@ -466,12 +470,12 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame) } if (!cuvid_is_buffer_full(avctx)) { - AVPacket pkt = {0}; - ret = ff_decode_get_packet(avctx, &pkt); + AVPacket *const pkt = ctx->pkt; + ret = ff_decode_get_packet(avctx, pkt); if (ret < 0 && ret != AVERROR_EOF) return ret; - ret = cuvid_decode_packet(avctx, &pkt); - av_packet_unref(&pkt); + ret = cuvid_decode_packet(avctx, pkt); + av_packet_unref(pkt); // cuvid_is_buffer_full() should avoid this. if (ret == AVERROR(EAGAIN)) ret = AVERROR_EXTERNAL; @@ -797,6 +801,7 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx) if (probe_desc && probe_desc->nb_components) probed_bit_depth = probe_desc->comp[0].depth; + ctx->pkt = avctx->internal->in_pkt; // Accelerated transcoding scenarios with 'ffmpeg' require that the // pix_fmt be set to AV_PIX_FMT_CUDA early. The sw_pix_fmt, and the // pix_fmt for non-accelerated transcoding, do not need to be correct From patchwork Mon Oct 11 15:36:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31059 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3822244ioa; Mon, 11 Oct 2021 08:38:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUL+Var3snWYOhTaYgdZFP1bH6Tkh6EsTdW/vGOHBsMe9VJR3Q6sABLvB6C1t7rHRXOaSN X-Received: by 2002:a17:906:5212:: with SMTP id g18mr26544028ejm.564.1633966684139; Mon, 11 Oct 2021 08:38:04 -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 og11si11136464ejc.491.2021.10.11.08.38.03; Mon, 11 Oct 2021 08:38:04 -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=d60Gcz09; 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 01C8368A93D; Mon, 11 Oct 2021 18:37:19 +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-am6eur05olkn2075.outbound.protection.outlook.com [40.92.91.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 39D8768A8FD for ; Mon, 11 Oct 2021 18:37:12 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZzIsk3WN0LM/lilGh5SKw3rgopzVeWUrb9JMBBtnzWIKvlPIdC2yFPN9oBlA8X2GwobsO17kMHcZOgbKuvaJXHqYP+GTt3ZfB956vDsyy4IlKQrK6PEpcqhQi4b7yHE1fMVKqpmTHymnRhwuoyAiYKhHQopcH3udhuRiGDdqYn4hDP656uJwHFGzSUon2rjB/pxyQnQr0KkKYQ3hgSy/MkcgusaWiRabx6lV5iKLYv7SLQV6R7RWoN0j5eVGl5ZH39vFnvQdPX/s4Y/glAgKCMuQio8b+OSCk9sHDznxgVkyMzgj0ooMbdcRV/CXI2P9Zc2dwbx/ewqmX/u/87EcWg== 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=1wVKVzxQWVngunr+/1XHNKVvZ18Pvg6kIpzf8Wp3yy4=; b=LGqzp2By473Dfnr49qzFdgg2roiS/vdwSoQaAoUS+3bPJky4Ze7pveZsyvy0KLt9gMgB0I5b4NTXQBpMbyKId7LbHXILVKvHecow2A08/CopaNTviPtYS5r7aT5qaFmuHzHCKzThsEbZHH/OuWTXsXoAlDfIQNGCxn0/mGBvLjLL5tcG28+d/KXZx06mqsWoU6V+VtySX17NQ2S1YXqyN7BpFgVkInEjCTk3n9PqN/pIXs+U4m7h1MwMrzT5UsAgYgpovRrBqLA8e6CFkCpmqNpisPVIdpSA2uHadMahley8BmnOzCcm/Dbgj7/ei6ptIVka8loX28krlB9dZ7PPFw== 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=1wVKVzxQWVngunr+/1XHNKVvZ18Pvg6kIpzf8Wp3yy4=; b=d60Gcz09iPts55uc1WVnEOBiodU3uRm3BhCBbAq9OTibqgBnUW2DRYDor0HbglddNFXaCEXBs/kKTp8/vLbxWCIA0Bi/SWlOVnGLH3Vim12xUM4+V3HWjs3gSjJmu4LuV+V46A5xQWBxM59j8YGzA10yWnQfkyH346SKFBzzDmgYruBCz/YlinoX6l41XDebt5z9qex/aP6gM3Vmn6YU4D60JZwPWwNSoDdKy+C+tgfglVgVd8hc58wk8ImNlzvDGM2la3DiATLU7s2x7fpCQMMiwBPhO4LpgzBXKISigrK71tx7POh7pqaKcF6PZo+NSeCnrUWs4h8T+r0gHxkpuA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5046.eurprd03.prod.outlook.com (2603:10a6:20b:88::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 15:37:02 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:37:02 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:36:46 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [U5yklsYaZvG9pBTlR6KMOUXRdBJ7ycuP] X-ClientProxiedBy: AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153649.1961025-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:37:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4bc8a78b-14b9-45e9-eeb4-08d98cccf8c1 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiS6+TXmMYPOjHmO66YJyNLlgM3Diumx0bgzb1LagqorYIq+2KE/z1TnwIrA8Xxszl/JrJvNG+tCsJn8nZ2TDVwYKlToAyXXhHOuT9YogfrmmK014fe/L7xPc18WrnnlIRVF5ob3zFlGVzCP2jq0P55QEo8IAZ+lBxzKx1v4iaPSUfuoRx5y3nz8bGrzbS4P5B2d5ZY1fH9oXAcStwayJphoF3OLldG6SW3exEQGxDcFXwutb+SR9vVJDlDAZLVfVE7SkVvft/MNzUCF/qvzFJIjIU/OQv1GxHgODH+hvr8y5xXiPWZgzED1/s7ETMDVWlDDem88XK2N8USO//b2NfqyMHoT1txuAyChaDp6+4fSnavWr1atc1N5r04Qm2p0G7gShqUGAlq1+g0e3QuXdq1pZUbV9n/sfpgUAtMka0AwNllZW5/58Y3d+6EjM8Y8TW2pD1JADN9BUs+nI0oEMgOREgD1WtFaI+S1pfkV2gWZD7s0IBu/zcVarUi4QQ1E6R/R56ps/rQIZKhID/r6JsDWvUex/KuTqvr9FeYoNdg3urcyjKtAFowTU1Gcchf57YS8JDZQdqVqphDvUScJ8V4zyONSKezRUfoTA7warKp+jrGFJUdGO3LEqeRAQ5xl3rwrOSHuNHfvwRQ5Bt9LKPEsZNOoGb5vOVosTxjX+CJDf7GV+YLv1Dw+EaQ0m9W5mXBmbdccVEvQpZPa+k+/Yzb0K+HVxohvmjjYZ6e18X6IVDUTbZa2Opz8SK7/hvaOfDc= X-MS-TrafficTypeDiagnostic: AM6PR03MB5046: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zfkZZ7iQjl2GrIRHK5GM1by917BXmBN7axZWcPFZGGLWm0QPcSphgqwjJidm0wW1tM/OCn3DZ+Cp8icEU5V+S9l333p+7j+l6Wj+YwUGlmd4auVGurcz54rYUgdDr9xKvomSSOoT2LN4z9tHU+yIv7KMXArwbDzZU5Ss034wKnS0iPMIv7pXYRqG0kYcm5hk18gQhC8gSD0usvOMaVon73aS+u8bIGMyQbgtplplkQKdg7dGAUIR0py7LP4fl0xL2amO/2GBUXe7NkQZqdGpsgkz8uAOHQZLOaifVAnkLOpKbG8inTNn8CYZ10mYXU3hTPxxuvXR5ODWFnQ3kp+tTZXBnGWjRs+2bCu6tRcYwhQJAimxJ24MLgxwpjAxjNtaW1TD3ySoBBgT4LNpVCdMJ39xHn0UesIaPV2/ZW5KQpzSIivSmwelCMrDnjKQUemK X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9wnQO+asf/5nKqJobM8t49thK6VsVB0U6nXrBRCbvbbscuqx0BbfGXhlAWcnv7d80nyABigAFbVav4Xw55zdj2QhZd/4N8s1PJlJV9V1uEuSlq3bhvruMmW6jheqfEXaJcKJScE+fFFm3JNAFmpc9w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bc8a78b-14b9-45e9-eeb4-08d98cccf8c1 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:37:02.6552 (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: AM6PR03MB5046 Subject: [FFmpeg-devel] [PATCH 07/10] avcodec/libdav1d: Don't leak side-data-only packets 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: 3bm5rAzrs/vZ Signed-off-by: Andreas Rheinhardt --- libavcodec/libdav1d.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 2807210e50..2d5fccec71 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -328,6 +328,9 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) return res; } } + } else if (res >= 0) { + av_packet_unref(&pkt); + return AVERROR(EAGAIN); } } From patchwork Mon Oct 11 15:36:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31062 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3822403ioa; Mon, 11 Oct 2021 08:38:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk9C70Rd3TeD3v3VbvV1xkvlo1pNcHxwYdaBEp9/nZBpbn7Nw6PN4Sy1O715e1HcwTyJMp X-Received: by 2002:a17:906:7805:: with SMTP id u5mr26505217ejm.26.1633966694960; Mon, 11 Oct 2021 08:38:14 -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 z9si7864595ejc.139.2021.10.11.08.38.14; Mon, 11 Oct 2021 08:38:14 -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=Wpfln2YD; 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 3174968A8FD; Mon, 11 Oct 2021 18:37:20 +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-am6eur05olkn2075.outbound.protection.outlook.com [40.92.91.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 74E5F68A8FD for ; Mon, 11 Oct 2021 18:37:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UEJXZCLwsTmBnn6xzVN8lrcpKKmEgYjbGmRUqOu0EBcQUoiTYW/qEju7z8ucH2ZeG93NhpJdJQxyDYsvpi+LhxswMMDzfUXpk1pumCOXd6zrGx8hslKq3B+QUCiAnz84OjWWm1DzWSsx2WtsFt4fryX/Il7SSNhuiGpbq0l00omBN7WUvCbMAb1VHCXlq7fgp8NJ1K1TW7GXuoaSImIz/TUx1xri4/Bk40kais0zR937kqo/KFW1/lLnbXE/1p3BDf7GH9juJzfMKG3pDgzRoDH7mdZKagiA2iOvCj4Gd2kwG3cJ9irI7fFh8dPcrBTaZQtos4nBQQLDwx8NQj2LVg== 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=lEeHGyLFphYEAsBkNTYnUVUjczX2LPyQKKCrfoYbTl8=; b=ZdvBJWeA5ylwItwNptWWvGuOWqkUSWsJAYlTNCT1PfuO5a2TCr3U1rsbP94LSrq1AGHYpz4b/DubB0rH6RXs+HG7z/B4hw5vfknjtuOJScqzZKPPtHpUsTQjpqrFnWoxOmKkKtH3ZEP8g8TtK2lblIbEVTEv1S9I1YyXlOx+38FLAj0egqnMJtGwUKfR1GzsoOddWp1x9JDeXSBw+ICZcAq1D13b0qIdZwvlIwpPvUqzNDmAPgkq6oY1IxVeKFP+bC2dlwBW1Pg49b7k3ieAasF5vWhCYGDFCcZMJuRXHksvxj0SE6O6c9ZGKz428i1a2uz7XvR97SYTCvGuCFlQfQ== 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=lEeHGyLFphYEAsBkNTYnUVUjczX2LPyQKKCrfoYbTl8=; b=Wpfln2YDfj3SdzJHDykSh3g0gXYxT+3rsxeFTZUfYGherJY5EqcAohqMFAUSu4kaBlNw4K2L+zCbKEHlLc5B5EL/KzQabObkYBmLHJdeuFN9Ed6H5nkvHm6oJOoF4e7y9+XaNaUf/W9y6GCBu7tWCrsV4WUxxmJMVlDlo/1kf2eJ7DcJEBCWUuU3xnB2f3zY4Fng7pHsag5BGDQd/uYoUaQzZYh/eS8h0sg4a0n3t37lbd0e6mMFCv3jZnmutfV9yYr18lui5KxkEnWJJ12Hqx4vUGF9CyXlSvstlZY03QHMxa4YELsOeyIUwoWO5h3iYbgTJH0SFKD/ZkAMQg1Avw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5046.eurprd03.prod.outlook.com (2603:10a6:20b:88::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 15:37:03 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:37:03 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:36:47 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [RwGTleZziWxUTETUpkSOW/dSVOijHfFp] X-ClientProxiedBy: AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153649.1961025-7-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:37:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6ebfb452-7ba6-4faa-3215-08d98cccf951 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiS6+TXmMYPOjHmO66YJyNLl/W5RZ6AwvTVjFXS+u7wBsnREQIwvqJbK+DnriwSAw7ygXbmjoDKAKubmGtBxZ/YBAirLQV7ksidCrCpgonz4r/k0B+nTd9bOCTK/9QMKKXlAdCG2CJYvT5RgUN1dpGxIen5t/K2ZK0jz176ALGRFr6uDNUj/qNBaQRgHhy+MCKtAlHABs6Q6ZGi56LIHQpWVngOmNsnsPmCjGpZpp//cXauQ65LWIgfdRt269x27HkrgYRkXIHp04+cisuS97/ZKOASFd5CR9RkyowEbtRwHO9fzhSNOF5JIviiHq7XvALfQoYzOs3+PmrpXYLsgaxWQ98lJ5jjwvaTxTL9FFgwGbAL5zhG+WVjH6hbVNZVrUV9MWWLG+7p4l5KMczqm6TDo5Y3Us2TboXj1mQ6LivaOv+u39DmXsBze7j/MX2q1UzCmh7LoVDdkNoINHk9XRbUhEDJAC26nsTisEv5pDoEZ7vdkLTtBVDuhaBuw1BhgzAg5/QlhFwAV3SmQfI8PWVHnFfKqLW7ByTsyh9RURNBrnLA03Df6FfLFKx1ECOq+yWAahm/4cOjK+uxaQnAiGNGslXGQzCsZBzpD+vfq3/78seFOHOgjyH7l9lNnr18gBxJljAHwiIpBxksJWgqwWnF8zAel9Kw1dE25IC0PNMFvHHerm+K8QTN0epE1LxoC3SUXysw/swXNuk2b3uZSAqID3gMky2Dhe639Pi1OigwrKpXpsSk4aLoqkTdtf224SPI= X-MS-TrafficTypeDiagnostic: AM6PR03MB5046: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hjwlWdvuUY2VOgRtGyTPNsvhm/xH61b7x6rQELhBHqZoAh8omaIpQTSN4dmuCKabYYlZeFxrWTNAw1BKzhOrq10ploICvZUSIFu/a8mED5p0ltXgU58hxzwFRKo8ZsJHVBY7wlEvD6J0InzOVyZZOazMT8Yl4xw6/Xp0keyfdFjeq9YAgrja/d+V6F0vZ/Bt0pVLzuoUmLasqbZW9R1dNVoEiJLSKv8sgtn+KB+9fUyIvX+IJOLLPV9rHZSBFqEALLhdURcqWKcZdw/Vgff3jSQbmXTNOwnCySzlIg7fGbvFaMvhJ6kFFaJcpoZvTeCJQnkGY/ygP0X7PeIlzkkgvtJPJM5g3IDk7TlflZxo6AcTapE/+y6luuAQOpQKKmzSB+DhpfgF/8CwFNZzpaK+3+RXCqkSjGtb2EfSYD24mQOMj/E9dQkvEwF1a6F8aQ1u X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q/Sum50J8bsKkyl0EGwaVbCx1UJcvCks+I2HdlYt5l9O93vmwlh8Wuq8cFe319M6m+tcIC+CfjIImVdYg4cnPO7I8tyM57hb8e26iYqKbpCkUw29yVOuiOl7R2sKu1onOwY6qUOTqyhkhE1mCyvRMA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ebfb452-7ba6-4faa-3215-08d98cccf951 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:37:03.7006 (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: AM6PR03MB5046 Subject: [FFmpeg-devel] [PATCH 08/10] avcodec/libdav1d: Use AVCodecInternal.in_pkt instead of stack packet 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: QuL5VXWmisLi Signed-off-by: Andreas Rheinhardt --- libavcodec/libdav1d.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 2d5fccec71..507aaa1a96 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -40,6 +40,9 @@ typedef struct Libdav1dContext { AVClass *class; Dav1dContext *c; + /* This packet coincides with AVCodecInternal.in_pkt + * and is not owned by us. */ + AVPacket *pkt; AVBufferPool *pool; int pool_size; @@ -214,6 +217,8 @@ static av_cold int libdav1d_init(AVCodecContext *c) #endif int res; + dav1d->pkt = c->internal->in_pkt; + av_log(c, AV_LOG_INFO, "libdav1d %s\n", dav1d_version()); dav1d_default_settings(&s); @@ -292,25 +297,26 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) int res; if (!data->sz) { - AVPacket pkt = { 0 }; + AVPacket *const pkt = dav1d->pkt; - res = ff_decode_get_packet(c, &pkt); + res = ff_decode_get_packet(c, pkt); if (res < 0 && res != AVERROR_EOF) return res; - if (pkt.size) { - res = dav1d_data_wrap(data, pkt.data, pkt.size, libdav1d_data_free, pkt.buf); + if (pkt->size) { + res = dav1d_data_wrap(data, pkt->data, pkt->size, + libdav1d_data_free, pkt->buf); if (res < 0) { - av_packet_unref(&pkt); + av_packet_unref(pkt); return res; } - data->m.timestamp = pkt.pts; - data->m.offset = pkt.pos; - data->m.duration = pkt.duration; + data->m.timestamp = pkt->pts; + data->m.offset = pkt->pos; + data->m.duration = pkt->duration; - pkt.buf = NULL; - av_packet_unref(&pkt); + pkt->buf = NULL; + av_packet_unref(pkt); if (c->reordered_opaque != AV_NOPTS_VALUE) { uint8_t *reordered_opaque = av_malloc(sizeof(c->reordered_opaque)); @@ -329,7 +335,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) } } } else if (res >= 0) { - av_packet_unref(&pkt); + av_packet_unref(pkt); return AVERROR(EAGAIN); } } From patchwork Mon Oct 11 15:36:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31056 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3822587ioa; Mon, 11 Oct 2021 08:38:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvKkHXvGkF42VL1qFMingD+yjpPIwGoAb1VGPYQqmfk1IFjrkOJSzMFNBAcIalDyx1kSKY X-Received: by 2002:a17:906:38ce:: with SMTP id r14mr25792790ejd.268.1633966705850; Mon, 11 Oct 2021 08:38:25 -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 di4si16056014ejc.505.2021.10.11.08.38.25; Mon, 11 Oct 2021 08:38:25 -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=cyrTto4Z; 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 E707568A92E; Mon, 11 Oct 2021 18:37:21 +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-am6eur05olkn2075.outbound.protection.outlook.com [40.92.91.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9481A68A920 for ; Mon, 11 Oct 2021 18:37:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k2SdtE3cyFX0+A/+KyEY3CJnzaQA0glSMGpKTokj6OyboFzlOoW56FblqxH8SrLCcBibDLnmh3eEf5TsFvxu0rcfP1j9LSwca1nM4jMZM8Y4MG3UD25LfLOOcpD//wa+wBEMMzxVlB056hMzRJ8r3ukbIY8Whtxh+HHLlbIA98P050+uZ9PV+5d+0e08QfnTgTOo9+kjEE5q0aa1ucZHjS11BAzQoKXntT6mXtMo9IAB18W90GrHlOkeJIWAjw7lvuthVsGk2Ji4QUlB+OA1fHNotbG/NDd/1T62mWMp04h8DiNi3/nipdtaqkaIqdqZ5PABOspuz0lHK1UE7h1jJg== 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=rVoHJgX8wriexxW3UcsKVzeQxnsWPbczccCmjCSyjqI=; b=HEBCrVPJCE9OOv+RgV8Oyd6NEAoYymJx+VIqR7l7GldTT8k77gj4z4oc/4zuuubrUC0JKip2cro7TJZgUMMIk1ku8vLGKiQubxQmLfmo3h3IkN4t/qyrnZ5/PCX2KzLp5gg2fppyXDzWpYGthgKcM4TLbxhLk6PKy7llIMCBxxBw3BcA2C+1tKjmgqPekUG3JJyOLe6kZLmtKOhaAUg8fleIZw4MrGEIqSJ9BvMqtqF4Ktjr4cRoWL2mVVZ5Ov+7Pxfp2tWN7zYPQJsnOuDFljEy119cjAhGfqS01oY+1/pq0sRZmKbfOuU1jKiLA560E/xtsGD250Mq5jfOU9JfTA== 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=rVoHJgX8wriexxW3UcsKVzeQxnsWPbczccCmjCSyjqI=; b=cyrTto4ZE4/Y/zkkYpNt4qtMaozj7o8kfJ8eFqy92O4Np0F9qH6Q7rTdo1sTmdazlU5/LEVBuiMoitQ2i5307jW/+MGgx+qx/eMhGG5cNcGHgTrgZ0BY0iPlf9jiKwXGxi9w7mJmFFSrG6xdvJoU2dcbtoOfuh3OZqD9blyyM8NUaCX7kAqPb/x7NvoUUxgDCc8CABUYHvdsesJ519XQVIBKRUpKbdiCyqVcWKfZgFwa3yZPBqhkL2n4MvdpfRa+WM3qMlqp5YJLvyAWtHIy35DFmMNLIUiLRbtwX4gRpNLhSAct/eLrFG3lrwjBzxINTuPXWdt8gL96nDXYHOc6zw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5046.eurprd03.prod.outlook.com (2603:10a6:20b:88::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 15:37:04 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:37:04 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:36:48 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [5xsk9aMRHzgk1xFTdgDjcIQaADXYQxYG] X-ClientProxiedBy: AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153649.1961025-8-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:37:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b91bbc5c-917b-410d-52a8-08d98cccf9f1 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVHD3KellvJ9YrD9KI0UMbu9huuvsJCwr/wUAkRhE4vMm1uHNeC85mN1Ez732doAlKIcNoBWDyFh59KV723YEVQUlSbblC29aScHr7uwZADGhgGePDLAcaugLFsBSmTGJvEZwHwG2Okh7R0AgzRAUOay6HsABo5GHXIb97dsirSxiQndbMg1yckwVqJxdW/0sgPdaJxQdc2U17MLP0q5slc6YMW8gUCE1baISdnhNJzN7Tgv6eogJLGN1wfkwNTaEwFqyf7TPFSKExX1iRTxyR9fD7kL1FmBXVrFidYnoi+g01IrfSh2pLmQf8G1L0E+5PjAi9WBFrWxkKcqvqPgxGt+jXiDb3pKkYRkUDe8gS13RFW+rNSPyIMIa9rcIKTUHT8oF+iSeWtJS8Cjdy99T2uJNJ4zepGZhTyQyZiLurUv+Sq7pWwJkpRdIAswkXGTAAOWUHXnjkdOpbr/ZBrF2PrZmRju9BMKpr9JH+NVrhRqCmbFmtpJ85/YeUtUz+RgNSJReHEEbr+hBF3GviM53QMldP5Dj6p3gkRKvVCvvCZ4hvAWzBbIgszOMhbfysxaJcS1PTvCTTYuwCZ+nJKTnylsYM7Sf+J1Gkk4As9nJztApTx5Vi/B5HO+4YF6gQkLW5soHiWNgX4jYD0q1FrO33hgnpPovtxoESP4XPOYFSbHsGM9WgMRlpYaBCQAV1fbEM0voiCPttU2FJitu8PG8XDAKyU+xHAcME= X-MS-TrafficTypeDiagnostic: AM6PR03MB5046: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kt7Rga6Iur8ZQHOXJHlsKTwpKfZBk2OG3SG/LkffhTwzTXuEsppTXMB7xwloSvbEKre0eu9hkRR8TfT4B4OK5NkEjUfW/9uOI02kybbGp20ttWJTIkPRAznL7i61+1GiIoD+8N06X9BeubzVkzqe0pWpgtqjx0uYyC+1jUjkDq9RgFgChyB8Oz0W/+m4DB0hKox1ZxX1xz67nE1KsLCrtLUA56h9ZljCegu+qQBOov54ao6BUnRrTkfRtFYSGL2R85susLz66RuQ9gmgIaBiE0n4+wBgPNHBIzilM2hAbmd613PQrpSZQorqAMeAy8J5znnnf+KsSdui+l/tk7c2n9IrCLfbUJLbxpr0aqBWofc78snP28WktMUYSTvnCS8VnNXuifE4p4ZQE7sBB2CzH+679odQrk/9sEjTLR+iUbgzwn4LULCBY4Pyxt7ISu2/ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FHpAm9ERbomuYvLI/whY+TZ7KccylxHdlSmmmPFMpIXpuUa/usghUawRqyTglc4PZV0NRxXvIJKbm7bhKeibX+AhVkKWrZPRgsU7eunMT7DwPhWSpHbbg5N3TQmBIRszx5b6aRksB8wRZIVp/eR5AQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b91bbc5c-917b-410d-52a8-08d98cccf9f1 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:37:04.7809 (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: AM6PR03MB5046 Subject: [FFmpeg-devel] [PATCH 09/10] avcodec/libdav1d: Use av_memdup() where appropriate 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: yY3/nac7m/su Signed-off-by: Andreas Rheinhardt --- libavcodec/libdav1d.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 507aaa1a96..bbc81a9dc9 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -319,13 +319,13 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) av_packet_unref(pkt); if (c->reordered_opaque != AV_NOPTS_VALUE) { - uint8_t *reordered_opaque = av_malloc(sizeof(c->reordered_opaque)); + uint8_t *reordered_opaque = av_memdup(&c->reordered_opaque, + sizeof(c->reordered_opaque)); if (!reordered_opaque) { dav1d_data_unref(data); return AVERROR(ENOMEM); } - memcpy(reordered_opaque, &c->reordered_opaque, sizeof(c->reordered_opaque)); res = dav1d_data_wrap_user_data(data, reordered_opaque, libdav1d_user_data_free, reordered_opaque); if (res < 0) { From patchwork Mon Oct 11 15:36:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31061 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3822773ioa; Mon, 11 Oct 2021 08:38:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz05H0yhhu6ZwuUpgJifZA1C08PYMRfUvkAhaUJk7no7h+6k4t8wsSXRqI++LwF3mhioX05 X-Received: by 2002:a05:6402:42c8:: with SMTP id i8mr39137738edc.349.1633966715153; Mon, 11 Oct 2021 08:38:35 -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 z16si16269221edm.21.2021.10.11.08.38.34; Mon, 11 Oct 2021 08:38:35 -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=NCBrJJjR; 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 794CB68A953; Mon, 11 Oct 2021 18:37:23 +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-am6eur05olkn2075.outbound.protection.outlook.com [40.92.91.75]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC99668A8FD for ; Mon, 11 Oct 2021 18:37:17 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mdl2uLUoOyrLNzkEOHkQYI/OM+1FaYh+XLSnGFlLAN0DntvAxKge0DVxhJvEsRG+zg9yufALiE3Ut9DA4EnnmEBInZxsMEJPVptEVnMqAEOuV7e0H1tvrBTaa+djraELmfpogdLOOYRxvkyjZ2oLlYdkYt6hRFCj8a33Lmv63P4BnHUTci1C9D+ULD5JZGsk1xij5LMB4tg4kzS9apEnSxjeYrfE0xZcFDZ0qk3gEjktaV5X08WQnQGE4xnDWKwewvzpOIRhGHTl62T39p1GcrL6iabG/dd4e3WsRcjK0gcf+hM11mwTNq09Rq86XzWQvKfEre9+gW/txZKvbjZG5Q== 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=fnP94bvuXiJOPP9x8dyjcuSOgUw1LtwYmnJ4lfMiRJU=; b=lT9R3leGsi/Wq2B5ZeDTUVv0bA4By1lymNdGOlpm8yP/G6vu1wnbrv9UFHeZYP1SMyB79eG57fJ4ITw0CEIlG/qHNFgA3tIKLxT2x8kjDcbY7fwVHugHK8yGNf7xIsVXFyxsbkGRWOlzAwHxnLYo552O8khwNwy6hkn+fAiM+SxYr8f4JGabAES014Qq6jB7szsAEi0jdw/N3cC0BB/pTe7Q7bW2TVkMejGLwJcFy6I1B2pB8H4FxSCkdY9Ut96oj3h81E5d1EGiOrN4/thlmzRJBZTe2wS03Kt7SGRjiHv6uBTI9pvqex5WawnVwlV8r9eyqFolqjKNxYV/2+SIWQ== 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=fnP94bvuXiJOPP9x8dyjcuSOgUw1LtwYmnJ4lfMiRJU=; b=NCBrJJjR2Fo+6ijHhApaBcYD+IaZYZUhzXqSOfFjMBp3kvb2Iq3E01f6RQobuY/+99/XxaVIFo+J/lW3Voppl8Hv7QbrVqpBjH6WbeP7DVq2q5VPHVOsW5OFRtoPmZcfFArq5bC6EnCnj2fY5LBkwZof+0MgyT1xp/WB1qgrY2jBuhBoS/O45ibzXGPItBgZ0wWurGE4Mm1U2CaGHPPZrBe5N9ZJTZq0mOf9Yam+VGJa9hybrTlgDq1Tolp9zK0AxGDO9/R1PM9NVgkpmOoYTmB1UZhRPJHAuoPalKLDkVK21h36tbfIceRGMyh1CCVKJb22XBm9WBt9taJ0eMmglw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5046.eurprd03.prod.outlook.com (2603:10a6:20b:88::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Mon, 11 Oct 2021 15:37:05 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%9]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 15:37:05 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Oct 2021 17:36:49 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [L3Z5kgVXQduqfK8IGcc3KVnfi21ehv+L] X-ClientProxiedBy: AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211011153649.1961025-9-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.170.49) by AM5PR0601CA0070.eurprd06.prod.outlook.com (2603:10a6:206::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 15:37:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 666b6a91-756c-4763-c1cf-08d98cccfaa9 X-MS-Exchange-SLBlob-MailProps: q+fD6XS3/UI6aq+TSwF5kAc6nHpsvHHu5izXn1bFfiBps/RwsKQnVHuk7bOj2cUAuAt1dQhneZ/MhmeKIHbtMKgLiQ9hNNMriYLGakluGlZPNKV+I8sTt3C9jzoivC8wL+cb433MGI4KXQ+b9SFHinvI/bO8bmmNtO1CW+r1lM4nWb4XKeKJnTbxHObqUgE8D3Nxqh3PAwq8ktxM/SJkhxq7O90k81Wuxa21oPwFT84tXtBGdbyaZzyUiLx0GIU6abE7iJ/0qWkMcaYFbAW+IDnAy6jB2m3ulfsVYjHHszaBpPsYVhd1i1Xw9FUWAZp8qn9VkDPs2NhFvzMkesCdCjSWs2gyMMuWY5RgH4ByoWl5DRzywwUOeS/CsRW9FH7aBFDHC7eNWaJO0YmGKJefbw36vttZLECVnoge0HsfeJG+Gv6o5i+TifPmOLT3gzDdIw/Z1oTqcQapzJ+WB61J6tOh90PHsHdb8Ogk9CcdE2DzOHNlz5zx8KM4l6VrKxfUxJd5mm9XdmASReRAw+CXfecL00hUKbKQlz898WLjDlFbKeNav29QTYhqIacJtdXzPVDs7mIppa99Eam3yOdsYXCQ3nxUYxHV3UeKpmLVKY5czTFKvSCSwKK1T9PCsSgjYD0Nwxmxkz5WLjTUWk40dX7EU7Oo9m7lETY7DVkfraqzmekrcyzKdkaV3xz/awQd5WK/CXU1xASIUxi+xHZEpg== X-MS-TrafficTypeDiagnostic: AM6PR03MB5046: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AdW9CV6zHmiXATnKjV1RojX52evEdNAAZzfdIeYDrMgEzVs1fiDP6xGov3Nw+tZIN4ODeHsiQEdRBRKKwyg6WfcIb+vCRYfyY4rhIO52Ul/y0GEylfM9TRm24i5nW6TxEKwVZMjuEM6NivyJtdveMxenLGbDmH22Z5sh9ZPA0KpgBfWuOiJmsQGA8G5WqQkjlWc4H6FvSa47h0xC7W9YV5W2X2kwGQ9TGaAxj4A5D4hACNy6SCnCnalUdyP5oHAyImzIfUFAp8XQ2z5ZEKIXUlmAwYd1us6GTk+p+JTQUGiawlKr7tbCuMMMw85WdjF47oXGEtP+6qfyLbYufmPb0iKNxgQlEsd8vX/F/P2PV2bJuTIy5A8SrIePsx+brnbgbVUkMupiWAQ0q9fnAgZjBrL9+uPEmPCrZi0/Bn9JjMEE8bkdYyxYdsbBscqBUu0E X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S/dRlYfSYdT5aEtkrg37zTvlTE0NllWCfG/+YAgRMmT0GiDdbRd0V1iQJ5vsHNmwZnwm6nl2tSwJkhWMtXcqQXG+gqkTIThzabtpUPrahvULR9pA2GvMe8s5npcL0sn65Klw9qgQ6utpivZtRpuarg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 666b6a91-756c-4763-c1cf-08d98cccfaa9 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 15:37:05.8293 (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: AM6PR03MB5046 Subject: [FFmpeg-devel] [PATCH 10/10] avcodec/mjpegdec: Use AVCodecInternal.in_pkt for buffer packet 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: bny+mYkKpUhP Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegdec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 7f89641660..8b154ce0ab 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -127,9 +127,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx) s->picture_ptr = s->picture; } - s->pkt = av_packet_alloc(); - if (!s->pkt) - return AVERROR(ENOMEM); + s->pkt = avctx->internal->in_pkt; s->avctx = avctx; ff_blockdsp_init(&s->bdsp, avctx); @@ -2960,8 +2958,6 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) } else if (s->picture_ptr) av_frame_unref(s->picture_ptr); - av_packet_free(&s->pkt); - av_frame_free(&s->smv_frame); av_freep(&s->buffer);