From patchwork Thu Mar 7 16:28:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46873 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c995:b0:1a1:738b:6bc0 with SMTP id gy21csp389688pzb; Thu, 7 Mar 2024 08:28:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXaCHKAvAuz8E/3oQoHyCpegq+SenlN/2eaKnSd4uYfpNFP9sFge6sCrkoVuDHbz24gge8Cv4ZX/Bb402aYDXRWAyRKMjX7YNpRSw== X-Google-Smtp-Source: AGHT+IFB+GjqXoUrwFY+MNa21pLKDem2Sh4LhCIXE3rJ1LA8GPxHgSp+ygc9KDebesRoZoC1XwVs X-Received: by 2002:a17:906:c49:b0:a44:7e16:af30 with SMTP id t9-20020a1709060c4900b00a447e16af30mr11999043ejf.63.1709828936029; Thu, 07 Mar 2024 08:28:56 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k6-20020a170906578600b00a4597044ac9si2813980ejq.985.2024.03.07.08.28.55; Thu, 07 Mar 2024 08:28:56 -0800 (PST) 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=SG0kaOUw; 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 973F768CA4D; Thu, 7 Mar 2024 18:28:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2099.outbound.protection.outlook.com [40.92.90.99]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6AFDF68C839 for ; Thu, 7 Mar 2024 18:28:45 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dJz+mAWWWhCdkygC5+/Kq514rcjITrjoJMrlNIU0KHd0Q1RGiJihx1OocvU2CJZoN35YgFkWY/ozxSFSD3fBbQqk8bR5U46+AVKYhgmLVuNRor5siz8OGCcDtyc+RSxDAmquzWSW1vq/lWYq1qpXOdR8TOUeKiRqb7OfI/mWRI4zztlpIHz/l4GO6B6OYMUFsXCN6w13KfTr5YGdl0wkpzBcd4i+R3aEaSwpzNShtVFy29Bz1egnW8srxR2LlAYyED80UWm0At0+RadyDj4bpCVtJ53SVK7QIKvicepXgWyyBVrhYmPmZcHbwfF3Nb15zLTMkP1Ptbz2AoB55xqhJg== 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=U3UDBlkSih+8DoorD0ApLbJJcJ6BKkoGR7SoUlHlbzI=; b=QaUnmcVGdFDE8K0LWsA7P5QeeB3hvNOO6eq3o6i2X7oNbUAzmKE7bcYbcKAnBhJbbfzx/JJMLeIXX9sxWEpkVEr0g7WXHao92oWn1cSOtqaZp09nQqYiyhTHKPBrSTBh3dXqXFvB0snp6rVP+DrBhkmsBhGPuOTcekN6B9Wd/QEem39RjLygP0rLwWOHSeTkiWZqSmBD5SQe7L7E4P5hSTZtlhboFN7g/QDquMpdabtPnryt24JoJfeoraHZ6tSE5mBQMBCsVSjjfxneUNB0XRzqdf6VRgH1/nf4O6Edesl6PAr3oWt8yNI33/a6XY52PCPiGSBB21Xt0hPf007mMw== 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=U3UDBlkSih+8DoorD0ApLbJJcJ6BKkoGR7SoUlHlbzI=; b=SG0kaOUwl3T2qTPtDqIUs6m01qImQYPoC+oVdGuVtBbsxLxTPKXgriYWTAKV9NVNj/zLTnqX+Nl/N28RznR7vz6BdO9ceO4PCPJXvOIyK97N6BqMHs+csiiIesABvwe0pdsgHJi4GkejNK2j4PGO+xYPbn8jpnVYvf7wLQ8B/DPfXGRBCX2oMdyzhYt1/GjSW96CPABiFLRbO/dGanz4KMBJ9Bee0zO/WsoDTN9dmkMn3dQcWt55X/Lo3CeZ5mWjtmostP7E2bJ8JwVuES8BRVDjjCMT78fcSLV2k6KEtT4EpZLtk741hpPec4qUMKBqOwnHQdTO7e8NUtUCGsbydw== Received: from GV1SPRMB0052.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:109::15) by AM8P250MB0074.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:36d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.26; Thu, 7 Mar 2024 16:28:42 +0000 Received: from GV1SPRMB0052.EURP250.PROD.OUTLOOK.COM ([fe80::a8f2:5082:22e4:8d1b]) by GV1SPRMB0052.EURP250.PROD.OUTLOOK.COM ([fe80::a8f2:5082:22e4:8d1b%5]) with mapi id 15.20.7339.035; Thu, 7 Mar 2024 16:28:38 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Mar 2024 17:28:30 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [Ds8JActzUKd0q/LJL9DymppYme0ZszTDxZwYmbsS1Oo=] X-ClientProxiedBy: ZR0P278CA0174.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::20) To GV1SPRMB0052.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:109::15) X-Microsoft-Original-Message-ID: <20240307162830.3617091-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1SPRMB0052:EE_|AM8P250MB0074:EE_ X-MS-Office365-Filtering-Correlation-Id: 326623b4-3429-4075-f399-08dc3ec3a4ae X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B50yYCOdBVMlrxzc/ec5q8BP2Vpov2smYDOvUkgrA9IaoUUr+dLycWKJoreUdQFLqB5O3pFExEMD8ZAyuESJb1ynRT3Xb6XBzlm5ACtkJ03sdgyUqZ49w4Gf9W/SMgMYEYeb/99QM0a7N16jPv00n4MVzSVEsaA/TZ/2e/17H1JqKz8+4EiflFxmHoiCdLDhiFV05pNtK/grYQ2hGvzAaFIJ/X/+HD8ZhfO+1/MWq6sA1ikS87QWn8r04fL7VPQ58pv7BcbWSBOzJ3FjT6CyTgiLoi8uKTJvLE+VBUhp3JwO/j9k8w9W8gCO/cBIDESjTlpi4wQqI0zwaqJygPgOstTD/Mosi0fS5jREHWRsrBbcd9VzcYIflp1m0st0HAntywxgT+hKthkVyIAxT9r7/+xkV5yY5vXLKHes5Hr3M2SfjE0LYTloevTPjTPmi41pYlI7iu7+COI7qu2+M0DzEHGwWt8yLtJJH3FgaqkAoQZK/CgQnNeZx2/znuDox66jfI12ZVL9BakSulpOnmmhW/4lPii1aSJXejvppagZ1hI3YuRJ4+I1UlHVxHKxrFmDAnxJtXePmPgJrsQzBFKG/LFBSc4XQjW+zJ1/x3ZI9RDSmuVaDIdgpjSSen3p8Xd4 X-MS-Exchange-AntiSpam-MessageData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eutKLwLWa/j++9HGQWCB/j0jZ60DBMMjZvL8XG16tb9jAxv6cL4iPsTZ53AGhZhZIAyGAJUvTyboGgLQyj24eeKI8UANRp40lC9C1xv3WmA/MHaWZt/wCyJFvx7oylwC+HnMx0QWf+k917hxeO+dns9q/vmuuWMMVhq+VAMQJSaHbTgRLrmxisI0Ut/LMStlg9fhfgTkDHmk6IR2oh+dLcjC9KkWXwcxdBBSWsQDNxkayew== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 326623b4-3429-4075-f399-08dc3ec3a4ae X-MS-Exchange-CrossTenant-AuthSource: GV1SPRMB0052.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 16:28:38.4386 (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: AM8P250MB0074 Subject: [FFmpeg-devel] [PATCH] avcodec/librav1e: Don't unnecessarily create new references 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: fFsu6YGg5gFZ Signed-off-by: Andreas Rheinhardt --- Absolutely untested (not even compiled). libavcodec/librav1e.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c index dbd728a408..2a6d8bfbed 100644 --- a/libavcodec/librav1e.c +++ b/libavcodec/librav1e.c @@ -472,12 +472,8 @@ static int librav1e_receive_packet(AVCodecContext *avctx, AVPacket *pkt) if (avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { fd->frame_opaque = frame->opaque; - ret = av_buffer_replace(&fd->frame_opaque_ref, frame->opaque_ref); - if (ret < 0) { - frame_data_free(fd); - av_frame_unref(frame); - return ret; - } + fd->frame_opaque_ref = frame->opaque_ref; + frame->opaque_ref = NULL; } rframe = rav1e_frame_new(ctx->ctx);