From patchwork Sun Aug 1 21:13:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29173 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp1049087ioh; Sun, 1 Aug 2021 14:13:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj11sr+QuvUH5MdDP6jts9Xbs4WhQkPL7oD+jrQulqW30IlA8GslrmhBbZBUzqtWoPXGee X-Received: by 2002:a50:ec0a:: with SMTP id g10mr15614593edr.125.1627852412303; Sun, 01 Aug 2021 14:13:32 -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 d28si7722990ede.521.2021.08.01.14.13.31; Sun, 01 Aug 2021 14:13:32 -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=L+GRhxMA; 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 6130168060F; Mon, 2 Aug 2021 00:13:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-oln040092072091.outbound.protection.outlook.com [40.92.72.91]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 087E168060F for ; Mon, 2 Aug 2021 00:13:20 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c8sqMrTjttZNdGg3+5HjXUJEtWdoRwPeFOWlCP3DzRbP00a2sJTUnsp6sq6XsnmY6eKvM8YMPz7fNL35N86NDBnVKa0jzyiVKceseTGQZ3WVcz1lGtfaEFdtaoZtb7G2p0EoAQInFT1ydnR7GfCZgDahCTX+jBEb2+T0Zvtq52H2xtw0iutCSO3BVXcy71RY/tX/kSKf0/IsXDx60ULBctynIKv44nwwjzO6t8C5xEiTVveHzHzN34hADHkpCVRvJ2o8a3PIwUI+yP19PUqWzafNO7By+7DB7Ch0krHHXZ6bkbAVXadBPAjzbY2Kc4OvYq3pk0IlmZpWf70i2j9cYA== 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-SenderADCheck; bh=eLj1p+4JlVtEczuiYK9QdIuF+oy5Dk3s055rXzelNv0=; b=T/WitayLitXRYngV+Z0gdlnMrLvWeUXjjFBvoVt8cCQ/T0Dzeq2UQH6y09Hvf2DLOMt68sSVGfp39uzkUiunxQtW8LEjxtGKvIlBoDbgiWJe2DzHgmmSxrKdD8jNp8H7lVLs7/zxUdVb9Hi77CuX4Smue9tuTJjGvzEZL2Nvmp92kCYdMYCVZ6CB8IA5/aO784jfCH9niwTwpnMLSEQu+8e++0G0pAuZRiuwjGm1rInNDeg5xO0XHHo9VE6Tsc0OAULwFLjAlNUDyJdTAScIgsdrVtUYHQdMkmclYwoxoYrUcN0ynmVHz940g09HYemBL/0nfGd+psguflpDuglmbQ== 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=eLj1p+4JlVtEczuiYK9QdIuF+oy5Dk3s055rXzelNv0=; b=L+GRhxMAGAyZvELme2WLR30TWhfiHNYAWo0sIhAULq4Qm/pHzywlIHE7ByI7FYTDN7Xv6LedS9JFgaWTHU+BPOX9yuLuRKV5SM9VeGgv5S6dKJ+ADYVPVMLVuJPrzijRDo91CUuZlsHF9CUSDUtZv9W1EZ9yHU1+pqP+OQJ61oxP1FyQh4N2BUkJXXWel0oSseo0ghGL9ErQc3lC5ZJ0YKdai37yX4To6MXkQPmQQcll83buYtakQ9418BThJpEZNLGq9snOUJyzBsSixlBK9kOKq/WakGBPtgHsFARDxjql82MlC6ZurY9IzXIFhCUUzLDG3TeA2hVl7xWJr+8JWw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM5PR03MB2930.eurprd03.prod.outlook.com (2603:10a6:206:1a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.31; Sun, 1 Aug 2021 21:13:19 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d%8]) with mapi id 15.20.4373.026; Sun, 1 Aug 2021 21:13:19 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 1 Aug 2021 23:13:05 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 X-TMN: [JXJA2O3BOGg4bhT52SRNF9uZXQIfnbbD] X-ClientProxiedBy: AM0PR01CA0171.eurprd01.prod.exchangelabs.com (2603:10a6:208:aa::40) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210801211310.1005418-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.94.230) by AM0PR01CA0171.eurprd01.prod.exchangelabs.com (2603:10a6:208:aa::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Sun, 1 Aug 2021 21:13:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2eefc982-9e56-402c-1be5-08d955312fa3 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRC6LfFJetu3tzwViwha8R8OkzMGgOoIEx54qFbGH+7Snci26Ju4CVpS8Pu5ZwlKQmMvCqmg0/qpQdcm7Qdz4uyoXp3yW/9BX+qXdzvZ5jwkNcq984k69N4dl2AxcOqPyQTftQXLYIolUX2FWHfJJgCvtRnCs7DNmKhEyrM36rkK12vcBp8Y9vQDGZ9k3sJ1Ye1G6KPD/ACOzYJ8sfZshC9Wk1e7DmpLmOAwcYuF8cCWHXhLef4rm8w6D35acrzA7fiEb9RMphNXBfHdHXlonJxcyxHUG3OMx8P0zXSRbEixLCGv4enXTujokZhFM/410qPjYJsht23bf2RoPvM+mKcX22hzSQ8Jdioluyccmd1z+qgsUghGk6US0UOi2LfB0zkhS+pZGzJwk+OVLMvTWJZt2xkEkkEKC8xUD2mBkpK6Su4Ub+dxjJUcQtEgqqzbbZUAgoC81Go/HOgKdcPmXTm9VvterGVlS7tHPKS7iNTqzfaIKnmQoiJn1NW6izqYWAvBz9uqj46SWyDq1KFEYv68VNkkvqrWD1md1mCumx4WpcjPOwoRc41UDhGKVR6an/H/9UlbDyab1KN8Jb7/DlKUJBOvNs81SXMRydnNntSD4+lqI2uND9a3VI/7pQ+o5WTOxLr4PpLF6DmCGjkG0yNPvCQePPlmPjsaqAknmxxD9eF7/oVureOGHDicx8YWrJXfwwqsgsUzXsOLCiIZc136diORRF/yOLEWNx669canT7zG4gXQvUSzDE9A9e65Ss= X-MS-TrafficTypeDiagnostic: AM5PR03MB2930: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sUCgunQx9ztj03Dw5kg+Oe8WXsFedEYYDYPYKQS69zkgrAMxQttLrjamD1G/xhmCryEmNU3bHg8aGXXlZTM/eYuC8qxrvIQcS6wul2yXyyaRUxeVM6bc2HFgVveEs1eaglOIjZTbfkDGTYahhMPkpvh/zp+agc/heParSlBJQ4RSej8J0ECzzB9Ixl5vUXNW+XRB9JWg33aQ40VFX3UBIhvcRlTurpz6TDXM5A61Lm6P1CPi3otzzd2osErInncu3NKFHAKAu48MUOpmqICmFnBG6jDfExyP0Yl+fHTq/eilvYl2JyHyV9pxgsU6u9aDz19tbd7urzRmt/Xg+MsJXIO7emqmyQB7gg1iMYW79riujfz0P6BLih6EEnTxiYmTRXYHfWNKxL78JesP8BWi+AvyfmKWbhKqq51PqCa+aoDBUHVVDOvinUMedX++61Vi X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WsZhkmyopBCokWcT6zXDNXF64kJUAmm1izJ5MO3hjMCog3MvLHTkp5yVldl2sWblj1/EthS0wNPZUY3Y/fGiBcXCZdPj28ry/L2/PW6KElYsaFNCPG50soQhI1/l+640o+jGKG13um9rDYVYhSNAug== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2eefc982-9e56-402c-1be5-08d955312fa3 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2021 21:13:19.3818 (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: AM5PR03MB2930 Subject: [FFmpeg-devel] [PATCH 1/6] avfilter/af_aderivative: Don't use audiobuf for only 1 sample, fix leak 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: XmEk6wZWJBO2 Up until now, the aderivative and aintegrate filters allocated an audio buffer with exactly one sample per channel via ff_get_audio_buffer(); if said buffer could not be allocated, a frame would leak, as freeing it has been forgotten. This commit instead uses a plain array for the audio buffer; it is allocated when configuring the filter, removing the error condition where the frame can leak. This fixes Coverity ticket #1197065. Signed-off-by: Andreas Rheinhardt --- libavfilter/af_aderivative.c | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/libavfilter/af_aderivative.c b/libavfilter/af_aderivative.c index 6b3e4dd0e4..559223d5ee 100644 --- a/libavfilter/af_aderivative.c +++ b/libavfilter/af_aderivative.c @@ -22,8 +22,8 @@ typedef struct ADerivativeContext { const AVClass *class; - AVFrame *prev; - void (*filter)(void **dst, void **prv, const void **src, + void *prev; + void (*filter)(void **dst, void *prv, const void **src, int nb_samples, int channels); } ADerivativeContext; @@ -63,22 +63,24 @@ static int query_formats(AVFilterContext *ctx) } #define DERIVATIVE(name, type) \ -static void aderivative_## name ##p(void **d, void **p, const void **s, \ +static void aderivative_## name ##p(void **d, void *p0, const void **s, \ int nb_samples, int channels) \ { \ + type *const p = p0; \ int n, c; \ \ for (c = 0; c < channels; c++) { \ const type *src = s[c]; \ type *dst = d[c]; \ - type *prv = p[c]; \ + type prv = p[c]; \ \ for (n = 0; n < nb_samples; n++) { \ const type current = src[n]; \ \ - dst[n] = current - prv[0]; \ - prv[0] = current; \ + dst[n] = current - prv; \ + prv = current; \ } \ + p[c] = prv; \ } \ } @@ -88,22 +90,24 @@ DERIVATIVE(s16, int16_t) DERIVATIVE(s32, int32_t) #define INTEGRAL(name, type) \ -static void aintegral_## name ##p(void **d, void **p, const void **s, \ +static void aintegral_## name ##p(void **d, void *p0, const void **s, \ int nb_samples, int channels) \ { \ + type *const p = p0; \ int n, c; \ \ for (c = 0; c < channels; c++) { \ const type *src = s[c]; \ type *dst = d[c]; \ - type *prv = p[c]; \ + type prv = p[c]; \ \ for (n = 0; n < nb_samples; n++) { \ const type current = src[n]; \ \ - dst[n] = current + prv[0]; \ - prv[0] = dst[n]; \ + dst[n] = current + prv; \ + prv = dst[n]; \ } \ + p[c] = prv; \ } \ } @@ -122,6 +126,10 @@ static int config_input(AVFilterLink *inlink) case AV_SAMPLE_FMT_S16P: s->filter = aderivative_s16p; break; } + s->prev = av_calloc(inlink->channels, av_get_bytes_per_sample(inlink->format)); + if (!s->prev) + return AVERROR(ENOMEM); + if (strcmp(ctx->filter->name, "aintegral")) return 0; @@ -146,15 +154,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } av_frame_copy_props(out, in); - if (!s->prev) { - s->prev = ff_get_audio_buffer(inlink, 1); - if (!s->prev) { - av_frame_free(&in); - return AVERROR(ENOMEM); - } - } - - s->filter((void **)out->extended_data, (void **)s->prev->extended_data, (const void **)in->extended_data, + s->filter((void **)out->extended_data, s->prev, (const void **)in->extended_data, in->nb_samples, in->channels); av_frame_free(&in); @@ -165,7 +165,7 @@ static av_cold void uninit(AVFilterContext *ctx) { ADerivativeContext *s = ctx->priv; - av_frame_free(&s->prev); + av_freep(&s->prev); } static const AVFilterPad aderivative_inputs[] = { From patchwork Sun Aug 1 21:15:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29178 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp1050083ioh; Sun, 1 Aug 2021 14:15:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjHm66mBUF/jvGymxdWS+9uYwPtjrQ90lMaCyueJ4PvycJse6BSCCmVSXaGB1MNcBoaTQG X-Received: by 2002:a05:6402:11c6:: with SMTP id j6mr581715edw.349.1627852554647; Sun, 01 Aug 2021 14:15:54 -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 p31si10404657edb.554.2021.08.01.14.15.54; Sun, 01 Aug 2021 14:15:54 -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=DH58dVrA; 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 9ADB668A6E1; Mon, 2 Aug 2021 00:15:51 +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-vi1eur05olkn2039.outbound.protection.outlook.com [40.92.90.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1779968A62A for ; Mon, 2 Aug 2021 00:15:44 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fTTj0G9fO8wMoTFPk3ds9K5hQwS/h0zcJqeIbVrT5yaDa2Q1/Q1duNHCDouclVhuSvCeq+YKaKfuC468/DndnvyqGz/dH8e3o0gtObei3+32M6MSDNYMkY50U8bxaa2ExVAO8eJR3wV/oUd0xVX1BrKLntRrcX9oM8Lj2fhRhH2vILIIGStne7vyFVpByf6xbWrkGg4gn3sbrdhd+jC5pw7J0Hh9rdFKIH+wVFzACi+LfHP4JTZQHFUHMD2lVJfFHLL1PZuYuoB3Ot22kHMCindGRXf9yKOTvQ84fgCGUEewZ3wRVvc25r0sNrtSmbHcom4Ln+/+ikTBE2qNPEvXYA== 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-SenderADCheck; bh=e1/bJeRj943OYUuFjrp3GamgVup5P/f4MlE6GA/vLPg=; b=EbenXeBGgIxKj1QPy6Z0DQEMX0VDp19ytpgwXtXVYnjdcXUoBycDh1fRzjg1L2lGzI+Qt53L8zHnE3+RXgRA4HrsfPutmFXdrp4sy2GzqbwYw1LKyTsMwL4bmOBquBDILImlE5opnxLCeVdX2gPSdnSMq8BtfO4rnztlCO0PwgWamk04HG+2BLDoX4dtDhwBI2qJ1fW2+0C4+lrSDfNdmKUtXlIQisxR2mTVNfoZdJ7Qb/FZWCKcGUGW6m/CCjDTC6LHiJwbPbxmOP2muQqFT1LYZqs7X0XcGwAV8H75+3LOShvysp1iy+/74wwGrQYqBR5W195fCj/2XhWBOTjLSg== 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=e1/bJeRj943OYUuFjrp3GamgVup5P/f4MlE6GA/vLPg=; b=DH58dVrARP08DqLTpg6W4cnkADrqATNIu9Ht6lGomu+FXJrQRZx5lTc8/r6ENBuspcb8zc/QKwP+wZF9ghDUYUzdaQgqPwNczeGP6+nu8cCg5FoFghPZm7zLaJrmu2UI6GNE9H1Kgi4Zmc0bPe4ibeili2kKF5fZyyvQETZ0ihdHCcbs2+rDmKmvrboVKIYdHLjOQjlZV4lbY8FqRunl7YKw3VHA2Wld+ugV2NuFMyJp5S2CTxcvOP+QfVpJNFUO4xW29hv6sSRyX4PoGM068t3+FIl1DebfsSHP/Lhvuur7D4nd64JFv32cDCvOdtbtuobchzEueGQXDksYkEMm2Q== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AS8PR03MB7301.eurprd03.prod.outlook.com (2603:10a6:20b:2eb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.21; Sun, 1 Aug 2021 21:15:43 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d%8]) with mapi id 15.20.4373.026; Sun, 1 Aug 2021 21:15:43 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 1 Aug 2021 23:15:29 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [8WeA4ceBY/nrduFJJhDeTB80NwckZGe6] X-ClientProxiedBy: AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210801211533.1005556-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.94.230) by AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Sun, 1 Aug 2021 21:15:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 57a47fd3-5d8c-4ca2-ef06-08d955318558 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRC6LfFJetu3tzwViwha8R8MJgyGo817t8Tk+YruLFGUapvXEkI1AZvzT/8b3kduqHSwTMy5euEbTg7muyhKNcC5nKgSCyjJhQ6FBH41N5NPr2fR0aY0N68AF77JcPGLi4d6DXY+FPk5VXGzNdTdDxMex2qQDJ2HBRSAPfhWMSp9z7XXcxcD+O5NxVObmNFH1W0891FutpuUbqWVNM148iRCtu1KUsQ4cxTuqGxqbTFOlBqAkPSmeNNWbvwH2VNPnek3k9ZrW8DpqWcr+MjroJjUZOiCw7x7F1QM6G5E7cSThLLNJMF7jEYg3JXhIaNJnH3w20u3Jdvoacqjhao7ejmmpwdMJL2713s3x2o86i8ym4MTl6OnP0MibDNTaP93A+mE35/WBiBzaBb5ktFfnJCIX4xvkO79qYqTyBR9LRb7QEb9aF030PpWOST0T3mV2oIXdrqX8g4YjzvzdAu6mKKrA4ArKr3x6tvHMnsYUJ7qT2WjEYeGOa3xzcawx0fwnSQZnjEtab4zv6IaK7nuDPubbaXLoSzSA7KBZMB0uW03FVzSf/O1HgtFmkQ0dv6YpVQKsQ25x+FdMcfU8S2Ai3eRC2awo+rM05f9PFRfWRpJfan+tawVbKzRCR+6VT2j6J4TvzCis3t6t1AtJIJ2ycv7G6nrp6FZmw5JJHi9YuHpbPF3FaEAU/uGnKWTnveSX7eZBoB3aJ04TiclRGvdFAtPxnYEJ7qUBpAvEw3SuryQiq+Q5TiqFERcoRHGJAj3ik= X-MS-TrafficTypeDiagnostic: AS8PR03MB7301: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w2tPy863uXJgcL7gn/zcvrY4ZYPpxZ52Vc5ik1IPeTuqkajKZItNprl/UOdiHaCpPSlwr7GdaOF5ltLFjZ3xV8rq1PUG4KHzTv/WuvMD0esheOwKmBjzOYRWrpDTEhVzYvdAKQM4n5yAUVSpwU41fSqIX1yfl5KONb/8/r1/Ya7B4gkwniYWQvuPK/Hu8hs//eJrtHGhbIp+2C9o2aowB8gewfVFfY8L1KmcO1X08KHxsSIDhQD+xCrXNvRhkLgWRUhnoHQUBvW4xTgfxcB+WjYFow/qk+qGFM2kM0GVyCeOVT+7B5XVCF3J4QzG8+f+93izbjVsgcBUp4lZIevSoybTtY39OeFkgE+mXESTTavTfgYSFXIEEeR+loqTsWEz4Q/TNnR7UAyyH7EpbHseu1PPHD00mfMYHV/EylLjuKNTVsN4KvHS1eMBEiXOkfkI X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5J+icMVepSeRKLr7i+6AI+Q67yjAYCMi0NfZnhGUOjQ9aQJ96H1C4P00B8GFFxnvz/ib5iTObqWQC9KjkM+NeKA41Dqq+v8Ukgo8StdT7sAD4+JQdQ5mdYP01Sx+4cFIgnsLl2ugQgOWj7LR7s9BOA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57a47fd3-5d8c-4ca2-ef06-08d955318558 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2021 21:15:43.0464 (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: AS8PR03MB7301 Subject: [FFmpeg-devel] [PATCH 2/6] avfilter/vf_paletteuse: Remove redundant freeing code 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: WXfGECIpX8nx AVFilter.uninit is called automatically if init fails. Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_paletteuse.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index f07ef5d760..4e90927322 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_paletteuse.c @@ -1076,11 +1076,8 @@ static av_cold int init(AVFilterContext *ctx) s->last_in = av_frame_alloc(); s->last_out = av_frame_alloc(); - if (!s->last_in || !s->last_out) { - av_frame_free(&s->last_in); - av_frame_free(&s->last_out); + if (!s->last_in || !s->last_out) return AVERROR(ENOMEM); - } s->set_frame = set_frame_lut[s->color_search_method][s->dither]; From patchwork Sun Aug 1 21:15:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29175 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp1050143ioh; Sun, 1 Aug 2021 14:16:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoRHaL3+wYa6bD2PEoXOxXs/U6e/QXSYs2O5M8vYlu2tzjyi/8/KqqUTvP22MSwVr0ikPB X-Received: by 2002:a17:907:3e02:: with SMTP id hp2mr12720832ejc.4.1627852563314; Sun, 01 Aug 2021 14:16:03 -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 v8si8410648edt.425.2021.08.01.14.16.03; Sun, 01 Aug 2021 14:16:03 -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=cC6GdKr4; 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 B223368A704; Mon, 2 Aug 2021 00:15:56 +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-vi1eur05olkn2039.outbound.protection.outlook.com [40.92.90.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7333968A6F6 for ; Mon, 2 Aug 2021 00:15:49 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gUGW5aVk+TC6f0sXL+GO9iUAhHrxw5zz2AXqWnu/YVbqGZNCgAoDHCrGilcJszmmQwspUa7IJVxnfX25jo7hw1YIehTTVFa8sVaNPEhs+stdCqDJaOcVmtLN9Hzy2uxN3AcUJ9vynH0QEaXE1KyCRU4UBIRUpF8rOVlnYFdSkQDjSTbIFEdZYZ1NDFbxM8BwAz4MeHnjYu4Pai2cn1JaCoagoYVMAqtHGjF2QhjNYs00Jz6olDA/BAnpas1629kCiyyKrFUyi2LbNyW7P0jo6ujDGgJbnXyDrr6ka40VT29krOlNDrvm0CEvM8vT1QUqXSnnkyDQlUFuVTtPW91/+Q== 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-SenderADCheck; bh=DggYL3UzhPC0x98cEd+PmSEtsFqiSFoQjjy7F70fRNU=; b=f7ncV0NprEoA9DdtwMW/QjuMeDz6pAEmhhDP92QnntzSURsfyWWDg1/Gc58c3GVwgDwYh+zuzq2uOazu8DixPzJ3nd3tk6bgfLDUHcgdE1W5B0qtwF3eKNBVEfmSpc8RhqUotjWo3KDE6iF+ig+qI1AZIqUBD9Tl3vyCIPFrCoV/wiEqBl3iGczSsRKtPclpSoJTHsVa7/l3/DitJ4hG19SkoyxLyE8sMQV+2mr2kgZCfiXKc/h43Qa8EYPREwNwdU/2LJgKGFLc19CVSpfLZk4vcZScRhlRFDGfCP9I3SIWGWv2OD3bUr6uhBov02LG9/dDAbBato1a+UV8dBJ2VQ== 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=DggYL3UzhPC0x98cEd+PmSEtsFqiSFoQjjy7F70fRNU=; b=cC6GdKr4zQhZ9FGWQIQfGLixXX0SxvKxBdUTvLzahex2RfNAsOaXgFBjMRl6jxtTAQDppt/fPXLFzUKoL3qxmtCTO5GRVyohNTzXBK2LqanipCvAMrXCE+mSJ53BGj7BcvYMUsIar7+PYrkq8qXK0Fl46OyMzpmSGayx5hZrZEMeyu5KgE+oX5fGofodi4aKx/U2CQKUjmr6UYGmHXUWJ3dks613YWAomeS+hlbx73rUWOPgT5x4HnY/gtF6Z+T13M4HOUzbCVHHHpJmN6ybpv4OvsjkBAZ4a8ujZWj2OUmHrsGNsRt4403ryArT1lX/SM5Qu8XUYO6/K2bZvMgYKQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AS8PR03MB7301.eurprd03.prod.outlook.com (2603:10a6:20b:2eb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.21; Sun, 1 Aug 2021 21:15:47 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d%8]) with mapi id 15.20.4373.026; Sun, 1 Aug 2021 21:15:47 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 1 Aug 2021 23:15:30 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [JoelhuidXoVRLcV5njEjWcjpivVgZu89] X-ClientProxiedBy: AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210801211533.1005556-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.94.230) by AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Sun, 1 Aug 2021 21:15:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30443303-3b9d-4125-a00d-08d9553187fb X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRC6LfFJetu3tzwViwha8R84p5U58sl3DAd8WBpUYpRazc0MmGHCUDb4CL1kn5KCHTwaf488+WzG/scvslu0tGJjWyvNNx8CqlRNo6DeflbGnpKXmd2sSp6Yhe8Et6v4h7ZOSICz5eL44JNnXeLO7rR7L2hfRsFqywxyeLcqGg3YvGiOF+wQ9gNcPXSJQl7GFukdeSu0L53TsAXvkPfubmX+N9maBLpAWdd23drUYOTpLLzv7EpK6soo1ayRhU1NQev0ZZRgx1VZuv/IZfZqQBo8XbSgLgBnTJ+I34KIMMPqKwUG489cTX550emi2PSuizSk70hlxBIa8A9kiaJB2ozY+fJ1x+NguOAYRuxcLe741NT0FM95ZVXQmwnDL5YUbmTnSJRtGjp+E3k1twIMIW6h5rSezNVPCEIKhSYI0qNtp6yhG9xUSVfKXuHAe/fOQcUgXEMvxVS3gTTeO4Zg5mLKaBfcC3G0rtNX+7dYMkKn9QIMKR/QAOim9+8S8dhWuU0x+FEyEB93BNKNDbOR8XEZ4MRZ4adyCY6yN2PoPy8bw1KmIb8PC77hjW6okZ7ffbP8BLidNzg7TngXmKCH/cCeb8IKrBgPLqFJQKV3MMHjpRSIlC9FVMsTmhOIcYuii9GBjE/WCE2Khi4f4Klut38BIm+0GgKy+11l7XLzFp8sL5p+4Kc+sgNO2YSjj25OAzwnS1Wmy6OD8eOG1fwO40KVXEDP11DMsTvce9u4GDW0et/Ymm3jEk1HZCTirtAn+Y= X-MS-TrafficTypeDiagnostic: AS8PR03MB7301: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LtPEyPeVgejfhMMQBR2Bn8IEt7kq6Xcrrzc324KdB6LeWFhqByGBtT3M8wiaa+RKceyMzCm7hy6/MVeCnwwBjiCrMuIAWGp8qWHOi0Tzay65oSPBU8JBMl92apCDpyuiIM2TyMbRyMuJ0+S+Gakqn58Qnp9KV1GnkAja+0II3spGNh1pDrpLyNwZld5jHuxzXc5swB2sixJUV83cN+snvlVGId5E5/WDDqkGNHr9RC6G4jKqTUrdC+kg6CjTph4seaQEELqP9tIPiK+G87lWya8+Q8+0n1J+9qV+R1E0DWL+VwIqIlpocHE+inbKYHNub7exicCE33rql4mC+sRlEX23Y0VPfUP4M1EMarXSqDOlig1sE3o/q9FJXVftl11hoOeGIwmoGBkYebNlp0GmJIVVebXMJtsxmUW4QnnVAUfgAwr4SOdlsXruZuvfVQq3 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XfN0uPvHioUxmN1fgdKXE6y3dM/iVvNyCuiBhcLucvAG8/ui5E5IE0Tu1yZW7kqzaf6PeZZF2a8ks81JMgAUYttwCNRRLf5Wf+EnGGMazyXsD60zxztip5KA2YNLjDxKdF80Z2sn++CT3atqr6GM0A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30443303-3b9d-4125-a00d-08d9553187fb X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2021 21:15:47.4670 (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: AS8PR03MB7301 Subject: [FFmpeg-devel] [PATCH 3/6] avfilter/vf_lumakey: Don't manually make frame writable 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: sWeDlx8G8Cht Instead, set AVFilterPad.needs_writable. Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_lumakey.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/vf_lumakey.c b/libavfilter/vf_lumakey.c index 3f98d5077d..f6bb889343 100644 --- a/libavfilter/vf_lumakey.c +++ b/libavfilter/vf_lumakey.c @@ -135,9 +135,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) LumakeyContext *s = ctx->priv; int ret; - if (ret = av_frame_make_writable(frame)) - return ret; - if (ret = ctx->internal->execute(ctx, s->do_lumakey_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(ctx)))) return ret; @@ -181,6 +178,7 @@ static const AVFilterPad lumakey_inputs[] = { .type = AVMEDIA_TYPE_VIDEO, .filter_frame = filter_frame, .config_props = config_input, + .needs_writable = 1, }, { NULL } }; From patchwork Sun Aug 1 21:15:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29174 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp1050212ioh; Sun, 1 Aug 2021 14:16:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEmhxPCKLwapLatBDL5JlgEPqXbKRpBF0/RLesXYMzxKC0qv9PpQG7ipKEvRbI5M8/rNh1 X-Received: by 2002:a05:6402:b72:: with SMTP id cb18mr15372103edb.290.1627852572400; Sun, 01 Aug 2021 14:16:12 -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 i18si10394270edc.320.2021.08.01.14.16.12; Sun, 01 Aug 2021 14:16:12 -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=rsTf4F5i; 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 B4A6468A703; Mon, 2 Aug 2021 00:16:01 +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-vi1eur05olkn2039.outbound.protection.outlook.com [40.92.90.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 89BF468A71A for ; Mon, 2 Aug 2021 00:15:54 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oPCuerpUVY8yaCm6vN5Sm+a6PFx8VnU5u61IwdSqorjPq18wZOVxATaK2XeJOFKcat8JppNUvk4h7Grl8oZ3flzFdl2bJ9oVCuOD1o0rLm/WDazo/drYY81+GPZCvc8pjdNqG2NScfI3qA127G9I1CWpAErr6J8asmyQJvuEhDwdtQ1v+nutZXqTwSWLahz3N39SK6RSVMRF7PpJbHUZVNdL+PXsPIABX57iwOIwzWaBdvbVCoQdshRpjSB1SWKBj7e4wzwSR5MZxLdBTb4AntR2NrbOilAxCrJhDbHU6vKHKO1DOdzZoVxRrQCMeL/TDyjOoOHtOwKgcIJNtHIwDQ== 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-SenderADCheck; bh=JbLryPslJPiXPOMZbLmXNQWJcY61scshXLQx5xXJb6s=; b=Of4PGJrSDG5NE4wr9ryCnOSBX4h+V812N03imiNsdC5s9FbOF8DuDsFF5BJHykSAMmJ11push2OHR3LBUXwTxOfvUZwDIWF9hsY1waiFfid3t9cBhvtSNP9gzcd+XehVS5mZ5RYmsz7QwFTQUoubjsZBW73pGXr3qxlpTpUwfObbo+w6DFY70p9KiKI8qiyacXco5V7UHUwx6Ze0tsJG1uOXYWHPCSqiVZo8GooU0evppeqwtYtoYq3BDTMxobMCaIB+gLNup5Yvls0xS1QAbSqm8y07/+DKNqV1aqP2QUZ6CQnvEhrHrblz5gcAi6RLOrxv5KPaIfJDfyMqm659YQ== 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=JbLryPslJPiXPOMZbLmXNQWJcY61scshXLQx5xXJb6s=; b=rsTf4F5ifTYYeIMkGIqMfwWf81NMcvo7qyKZLD57Mzcik4GuyHS10PB9Hs7VcXc+Dss94D3vklqtIyXFCBkixZJ7IDJByzo/DzwsMNrvCO938Vlabmqug33F203/X2gI2CcKBKzW1I64EFLIG9qDnusttAxjiCAwD6ZhXKthjRhuhaX5qI11br6Sqymw6TBIsK56mFDFL22AH6Ib2BZADiT4xsCKz+lj0T+H+y9jHGXO8368CInvVv1yJkjlIJz0zqF2MGL7iMt034rOcFYO3mGQ6DZ60NQS+4+Obn37UbHrRr/WcYCrRM+2aJFG4HIwlMSVAJxS+mKuXoyUAHi97g== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AS8PR03MB7301.eurprd03.prod.outlook.com (2603:10a6:20b:2eb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.21; Sun, 1 Aug 2021 21:15:48 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d%8]) with mapi id 15.20.4373.026; Sun, 1 Aug 2021 21:15:48 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 1 Aug 2021 23:15:31 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [JL3nsAdF+k2A0sR9+uCiG97KXNHCWiWH] X-ClientProxiedBy: AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210801211533.1005556-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.94.230) by AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Sun, 1 Aug 2021 21:15:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f42b6410-f8c6-4b63-bea0-08d9553188ba X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRC6LfFJetu3tzwViwha8R84p5U58sl3DAd8WBpUYpRazc0MmGHCUDb4CL1kn5KCHTwaf488+WzG/scvslu0tGJjWyvNNx8CqlRNo6DeflbGnpKXmd2sSp6Yhe8Et6v4h6M8aOzr9mtbQor1VRN+YqfJ/9knYO4SK2W1Tso6ojTZkFdQ+AT7e8EtK6eBGnEKh34VSLn8psCA7aGNrqnzWnKvBYR6me0TTKiN5wzpcqf+sI2jtBiA8HjwzMvp5GIGLjDUqYLP4wUmjatXhcE4bdzhiF29PbmSdMXZS1X9RItTJdUznltcfzTu6sFgZ4uX9ehv9of7Mc0AioLjbHTHgbqD9ErwZZBjMhpvh7Rk9I2CyfleOawEX6CHXQBX4JZzL1MsG0EReysxE/pAsC10xLytlUHB6s2fRRGLLqp1u480ry4sm8eOKhCygD90EZM67hRlQHly21EBuBV3Ezyb7Dhp1yEUkcaYDzxtmZYcNSofjWV7rJAXZe44xfUgk6sCdM44n5sangDHRq5vZNkQxfhooFP41X9qJkGR2e4mgGlX5yaBXSSgAcwYZVOFDowIKn6+tH3/lOSdZ+wTfYUrKFvjzQvkasqLrSYJry+LZQY4Vekl5mt95UzI/G2m9J+YHXIyfx1RDbnYpyT8X2uibsC9gLYCcifzbleR1iR/YC9Y2bLzC9pd4x1IWp+WkZqIrfPMYgKeXDC9osE5UcEGfbcurI7LuboKxKi/DrUMlxgTXd0aWA8j1pfTJ1qqkEVcLo= X-MS-TrafficTypeDiagnostic: AS8PR03MB7301: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hwWSn54WdYlw5J5QQkUhCZOt7aOceFAx6j/Xi6zAMa7ujxbnYtagoSUBnEWPqcB4/YqcCctrwKhEqZZkN/jMz41zyA4jcnI+lXLOuea7aKY+Gpuc9sAT9LXeBgQi0ScbHN7SQ5SN+l2YMJKf9jaHSu43TMuwYI3VfDpvk7qdItLmoVqxRZnVT3l2E5Y/yMMWF0gDU5h/pdsHPXXsXvwOeGTWTdm+N1ELtCcYAC+tny31v4dMNyAa+NcFuTgZez05qqOB2B33G0O0VLmdiAHr3WMuzZcaZoPKquwyizoq7omO86wBcWmOuSnIhP/KWnqsfW3y5Pp6CznxYJgy2Bw2rvwWaN5E/+/mTG+ZsZc3Roj2UUqrq/xojRuzu1/09t00idvS+OddNRSY9GwlM0KfE8nCA7PgozHlerOxgh51jahVA1GS//rjA2K0abCBtEat X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qHlyS8arYHdSQvWwExOxkFAiveF7JEU9sW7wRg8q6oRGNbzQjlObTgIExXJNGIP8697hfUTZpHupXmF1Bar4KMF3j0fcFvZpvt+6fQC9n19NuS31DuRCxN7HJS5+r8mQWsTv+7+1GIxil1BSK2Bt0A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f42b6410-f8c6-4b63-bea0-08d9553188ba X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2021 21:15:48.7136 (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: AS8PR03MB7301 Subject: [FFmpeg-devel] [PATCH 4/6] avfilter/vf_despill: Don't manually make frame writable 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: iT7Ki53Tk1pD Instead, set AVFilterPad.needs_writable. Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_despill.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/vf_despill.c b/libavfilter/vf_despill.c index e0990d7443..6826d7abda 100644 --- a/libavfilter/vf_despill.c +++ b/libavfilter/vf_despill.c @@ -94,9 +94,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) AVFilterContext *ctx = link->dst; int ret; - if (ret = av_frame_make_writable(frame)) - return ret; - if (ret = ctx->internal->execute(ctx, do_despill_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(ctx)))) return ret; @@ -139,6 +136,7 @@ static const AVFilterPad despill_inputs[] = { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .filter_frame = filter_frame, + .needs_writable = 1, }, { NULL } }; From patchwork Sun Aug 1 21:15:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29177 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp1050294ioh; Sun, 1 Aug 2021 14:16:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSvOBVHROvu4a1B+yj5wbtPMihUwYSNYH/9a7POOCsDxjE3lF44wZy4L6VDwsXzQ5xZgws X-Received: by 2002:a05:6402:124e:: with SMTP id l14mr16172374edw.356.1627852581432; Sun, 01 Aug 2021 14:16:21 -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 jw27si7684104ejc.440.2021.08.01.14.16.21; Sun, 01 Aug 2021 14:16:21 -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=Drfz2nMW; 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 C83DD68A71D; Mon, 2 Aug 2021 00:16:06 +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-vi1eur05olkn2039.outbound.protection.outlook.com [40.92.90.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A08AC68A71A for ; Mon, 2 Aug 2021 00:15:59 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QvBmnzsGyP7Mh4Jb5poV2NHCLxkfhkPHgL/V5XHooTDvzqKWOaREhkMYpdnMaSeJB0+3hB443/P4HR1cLGE11+lZ51xsnxtqfAgbecNiYxkavTBVuoPrcnWHok9LhpvHTBWvGI9EesbQMdg0Y74ERWyzUhRm2/fBvClDRk+NRrKm5n87gSbtZQzWs7HBh5yDQG79DrwYoXoYHLnVGhqpOPtkUqwsYfL6Yh5SSyvvmRTt7f0jnbFveM893alX3Tkp6UzXcnesrWcb7tjlK+UbGp50A/TCUAX5YFfrfhPnRLLiGOtzAgyKj9bke5ZhYOj/nxWqFrmnhqC3r2CPqp/J/w== 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-SenderADCheck; bh=2aQOoowYw+OOb0TqQ+RVPcYSREkgfgY6OS4LO6QiIdg=; b=VEocfEkRzxjBfCz9UW+OnNFo1lY4BfscKlvcSXAYZOGO2zZmcXLosj3Ug4E38cJiVxgawNm7KP5jqe3nCDiSpJm39+z75sEiXqAI4/T/5i+XiVZDBpeSKfUpL4a2gl3eGFhzDN7xo/2b3Bs0U9ATCdK2WBukL2wEcpQnoLn5h79jXf0KZQW0uWLd6gNIUnps/OzcWz0X3KKWNxpHvwriqAm4uYChEArqY1+C9QWyuk0OTFiSeEbJ8NqpR/MKcBQ5I0szJwzAlow4pDWD4N/TwrKQp8vFQiq9ZXn9YVCqzOryiisXrTwq8QIJSCPSPyDzvdaORSZH0I6fTDjz8krg6A== 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=2aQOoowYw+OOb0TqQ+RVPcYSREkgfgY6OS4LO6QiIdg=; b=Drfz2nMWFDxXolY0V/zEucR1GQo7CR0OU7dW7hFxQyVzr9aZL9mf4nTYByRHt2jHT9Ujq3wJeW89u2Q275Dfo2Zw4TBqSkgTXG/zICRKfZUYvxNj0XFsQ3LtTRYcbNdHGCjS2+lVCA0ElX71OaC26z6kB8pT/cFcRlWEFgMcvu2y7yZv6eWUnuC26UkZakok48VOzJqidh8OIb1hWeg+TD55K7huaFiGwY02b5FmHCsaf3lCSn1cLOxGkX1z7ky2szdXQKnjFAdiWBRI1vfg4KccbNEn6odPsA2V0hVjy2Lz5565RbH/vv4JyWoe0SWVhIxz90FuvbfkMunPso1LrQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AS8PR03MB7301.eurprd03.prod.outlook.com (2603:10a6:20b:2eb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.21; Sun, 1 Aug 2021 21:15:49 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d%8]) with mapi id 15.20.4373.026; Sun, 1 Aug 2021 21:15:49 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 1 Aug 2021 23:15:32 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [5zZk7jxsY4wLzN9zfIMRQZcoge6z+eOA] X-ClientProxiedBy: AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210801211533.1005556-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.94.230) by AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Sun, 1 Aug 2021 21:15:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2aa0ec0e-6f0c-4ee2-8cf1-08d95531893d X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRC6LfFJetu3tzwViwha8R84p5U58sl3DAd8WBpUYpRa5nexCof4SM7qpbI1nXEW5ebruqOGTnGv7MkFYqS1WXg4zQiyVIo2/hm9L4D3YHdt4mme1ko4/vKqvJ8KgRrVgtLmh51CW3h2+b4VNWALT+zZm/azqny4MYu9NmfNeMgHs/UC7zmFUhDvGJijwJKKQp84Uv5RRi+SvajBk4+UQcfxN8nI3JHngOpo04uoODvda2g9XCrQOcubLdXfUxJAyHNevzTIhelPYt5BWJOYRuHkXHxQUojWI05797s0pg+pVROoHHioG0P7Zea4suudW3x5MaaDMQg2e9dhEqx7Qr2OjzUsSN5G1JPIucQ9haDoJ4F6NMkeS0wBloVL/fKxOCT27wdekzUKi/LsSHHF0BtFEccHQUOBszu+zXn7kC1Qbrlil5zdj7K72iiMntaeMgvaGjLD7eR/v3yxUjNyBRJ/OGdeG95qOwvjTeuprkHK+4n6L2thQ8DR0J42EYimBSLYnEK9Dm4IUFn4raXqNDAfhLWeEp8SKCPjcjly1v6tacKnoTcnX3FFgwLzCZPMJN8bTcnaiTmo023ESOEixeaVariGisHFdHjLOvj88DI3A1wIRmnLWNWI0sx920O6zpnOCzoPS8uUqzaTHG7vDgWzFS8qFu3PSzP9P579RspHnjn6m4sw13t4JaEiG7+cNdfQTMimuKy3+0Bj1BNeL2mI7JygSf7V2BoHvh2QjOkZbB8iPkqEWA7PnAU2mPTm7w= X-MS-TrafficTypeDiagnostic: AS8PR03MB7301: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dMWVYslIYo1DQsmiV2wN9uX86ZqwPUXS82fB5zrGX9FoYFTEqO6QXdzHMSws+rhpEWKy4CgoLNhG5Wl9WJu3iNV5/cEdcPjqy4/188Y6tlF4ze5q2ow0Tm9fsHyLtTYHJ2gg4oP/bERfwDjbHQWMyGVvdrMTlHjrU1g8QVYxRgiL3nly3tlwEq2GYYhg31ZS2SwcPGYfG5+1iNTRPWcKGkWT1QakHPRBRSz+dz8uaWC1MlnuexZtnMi4EqaxzwcjGOTXvUhzr9Tafol9xfFgrW4Ng9wq073lm9hEp6HjEGLAYSVCAgKByl7g/MUYzYNmSN0BjSb31TDjAh6BfYU8wio0IstiyIbR/bLlZEQ95qHc51AMzMgfLcaPgowHIoOEKLjwwstFlr5QCq1hRsJgg7OlbTOqa3JT5nFCXMgVKMjKu/TcIHRSo7XtgvKLmH29 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ozzvbuw2MvK1TAqFjU4yAJed4hoYeNTwscLPRs5hurp/R0p/A/o2wgd4d3dhePvJI7P1eZCB2A+9ZeoPET0ri0aRQWIpbqcy3BJbph616NhCfvjnxXFHlx0fTZKU2iGC6RgLWORjLXdydvK3wxK/Ew== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2aa0ec0e-6f0c-4ee2-8cf1-08d95531893d X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2021 21:15:49.5758 (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: AS8PR03MB7301 Subject: [FFmpeg-devel] [PATCH 5/6] avfilter/vf_colorkey: Don't manually make frame writable 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: aqW4UfISVrOS Instead, set AVFilterPad.needs_writable. Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_colorkey.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/vf_colorkey.c b/libavfilter/vf_colorkey.c index e0b4372842..f8b5c80563 100644 --- a/libavfilter/vf_colorkey.c +++ b/libavfilter/vf_colorkey.c @@ -135,9 +135,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) ColorkeyContext *ctx = avctx->priv; int res; - if (res = av_frame_make_writable(frame)) - return res; - if (res = avctx->internal->execute(avctx, ctx->do_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(avctx)))) return res; @@ -185,6 +182,7 @@ static const AVFilterPad colorkey_inputs[] = { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .filter_frame = filter_frame, + .needs_writable = 1, }, { NULL } }; From patchwork Sun Aug 1 21:15:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29176 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp1050368ioh; Sun, 1 Aug 2021 14:16:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3JNKZGQux4oKo2er2VWOkEIOor19u3zDtQ0igInsNLVePXG3prLQbAQwYGVL32tiVi5qG X-Received: by 2002:a17:907:2ce7:: with SMTP id hz7mr5924709ejc.35.1627852591034; Sun, 01 Aug 2021 14:16:31 -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 s16si7962077edq.234.2021.08.01.14.16.30; Sun, 01 Aug 2021 14:16:31 -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=LXsF6RyF; 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 A3D6468A76A; Mon, 2 Aug 2021 00:16:07 +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-vi1eur05olkn2039.outbound.protection.outlook.com [40.92.90.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C4B5868A74F for ; Mon, 2 Aug 2021 00:16:04 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aOvPXI7AMqSh1AVdTJWQ3iL3krYMvNmgnGwIh64WgRQs52eH+HCNbi5JFcnu02SLGELXoZsbnzuW0lHzvzwLIVOVVMxNWdBQ53Ns9sQmqbs3Zk3dkpa82X4j9IeP2f9EajvIHztpJ5LuijHKSLuFqZb7nsKd0wjYeKblLG7roFJNVT71sDQNFRyGh+Bojqffr26nErupmSFr0+/CPM86uwT92UogZAjGRbEDCe3JrW4F49noez0mUF0eplaIBC1w5Tw8RIbDeiUTzGt0+3X4YI8MWG5vfd3+wRx+dYBJBm6EOTH9E5p+QawBLIoqH+X3FS0O/Fh0t1c92H8vNu+9kA== 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-SenderADCheck; bh=Rmd0Xyf9YZiJHoPx4N6jyyDPA/ySReuQJzbN4g6xhIQ=; b=L75ST5Frxn/lxhK0AIuFXDYCzB9pUXuNYNw6s7LhCIiqGGo2UxBioPJ/EOuviG2Bw2HIxXUuS08MaxR0/5j/bnM53E1E3RASFkYITwpOll1WXWglZizV1qOlhp+YBCz+8PYkKPkUdZBBYMJytobnbSBhAm8oE7TuFhz/2HfjsX3nIhzqkluJjlytumkxmP09hohKmFRrEyR6ZwcZoVEfAOXu+jAM5lfNgA+5xfx8h/H/uyHBsI0WETptyzSrRfXTH6fCtPQjsNzk0AcBHnXdax+nVpPe3AQ2HRyA7jhaFNjRXxquOZDQBX1dNijp0SjIUtawgmLg5epKQHamiw6jcw== 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=Rmd0Xyf9YZiJHoPx4N6jyyDPA/ySReuQJzbN4g6xhIQ=; b=LXsF6RyFSNuZTxJ91fLyC3/eON0bbZ3qY7dQd3yPPvBBmzgA6oREFgXcKeQBIz304miHx2854XPkYxLhOyEYNdgd4an3p3AR19zAX4+nfXCNtDyGmDDBiaCMylNXsWTs7M0VdUe+mjRreVkfNB9kZ8QtqZxQ5c6FAWuLtcpRLTxhaB971csPiCbnVZ7pZLO7XpBYx/jU5KLGteFVgbCpVIGyPkFVSBF5+r8S4ECwwRe+6xCDkl8it5jZ36j3S2ZtO+cMkZaiN0QCvqU1RYYgG5prS3flXVWy7tTTpoC35Ne8tpC+leMuIzS1pPXOFpuHpQHK0YieqPo7IYZO3yhwbw== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AS8PR03MB7301.eurprd03.prod.outlook.com (2603:10a6:20b:2eb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.21; Sun, 1 Aug 2021 21:15:50 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d%8]) with mapi id 15.20.4373.026; Sun, 1 Aug 2021 21:15:50 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 1 Aug 2021 23:15:33 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [nNAlnNgmsyeb/lk9oiCEhP6l2kVQLTw3] X-ClientProxiedBy: AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210801211533.1005556-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.94.230) by AM4PR0902CA0022.eurprd09.prod.outlook.com (2603:10a6:200:9b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Sun, 1 Aug 2021 21:15:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 84d864ba-6a4f-4411-212d-08d9553189c6 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNWHNkBoEz0Th5/wkvf3BA3yoQ4ZvDohVSgUyFn87vzp21lE4iDsV+DDglMkMbI2C6JDot2bSy1MFzi+9BgG4EwUEzZKcv644aQ93VtZGFKIAyXPuDW6/QWCRoaK4GnXMeRMdi1dP2gQxvQ/5CvBc12JoLBeFk4+A17tnCYfMKmmjPUEsw+bbvfrsH8YO8I+VRc/y3RserP6sxEv1p7KyOM5kTb+ytZLUBAV18zOnjlUTld3MtZ8MQpDsBqedjlLnUZLZcalosZ28h45bFThT3YI8sLAI4F9rMTsG+G5L+/rZw7UMn+GR7qX1K7c8YQ2ee8JCwUeAZ8Fr52gG8vnIpnz+0QByden9w3ymGA9ds8vQRuvN//UDc26Ee4p1P9/HBxS2u9tSv3ErxAkxzYWZmicSWs7jJZ1S77p7VCxZ1+2eR7+jhMPyZYT3N+MzfDPqaJYv5QI29JOiA9cNR4STOr/tmi6luXFQt+fW5lRdhxSH/u1bCnXUltOvc3lzrcubKoxjZxnVso1khsh4m5XdinWSrO8Ga2XJ2Iw3RSe8rIZr56HI36jB85U+juHzHSm8GbxuSvOA/XFLY74Zan6y9+57zeZPqXU34xW2RYz4N22Q1Le7Q4y/SNmkXCGiT6PEvJTKf17AueaMtO9NTPEFeFtdHxvZY9971vIUSH8mHzrllGT3Hc9+ow1GVRdFC2RclHJh1L8zesMkaD55Ihu7LbvAmV/5Aa5vB8= X-MS-TrafficTypeDiagnostic: AS8PR03MB7301: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pCzRB1pJHm3LNQqL5W7nbHqfpjcv+xI1sPzzNkhsRx8cu5nCflHZJ9XaUurr3/0ZovHINUUBepfEzdtQLBVAsmECBmX8vosXMdR88QdQG36F8fyfmr2yIEhW3QUkLlypeOqSAIB3aOAaND8XwGZGPbuSqEPezjlcIivgODc3D2WkcNj6YlTY0qPAx8sssb0OwGFR73vYzPoukspUWGKFwhCpmvA57Z9SvMKKXlkD9sIyHCxG+6XrhZXc1X5/NgHQofcVI0Hof7h4Wls9aXFZR+oatuLqNIUpE7v9zHY4rbEP88Wffb5V6Y3RuZmegS97R9skDS24HY+i0Vu8kEqsflzUOjT2savW/+jv1lJH8jcOnANWNcekBEskFmcL5sq9NRupqNj9yisGzBvYwyV/IeFi6SNV/gQtZIvYoejBVpP5S1W1Sq964+ZRsxGwuOzi X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sypyKP1zcnR9oUwPLylATynQXfbY5kWSOHuLRmPWy5D+LELlpU2bBQbLgPPOFnRnXEHXIWdzUHaIxBNhlp1pYQ93MKWj6Naw13eJOAxu3/J1GI/z/x24KsbsbdR9jwabgL06GDH2L2gXZS1OqC27VQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84d864ba-6a4f-4411-212d-08d9553189c6 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2021 21:15:50.4560 (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: AS8PR03MB7301 Subject: [FFmpeg-devel] [PATCH 6/6] avfilter/vf_find_rect: Don't make frame writable unnecessarily 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: Rye1AHguSZkY AVFrame.metadata is always owned by its AVFrame, it is not shared in the first place, so one does not need to make the frame writable to modify it. Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_find_rect.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/vf_find_rect.c b/libavfilter/vf_find_rect.c index 1a94655b6b..415d633579 100644 --- a/libavfilter/vf_find_rect.c +++ b/libavfilter/vf_find_rect.c @@ -225,8 +225,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) snprintf(buf, sizeof(buf), "%f", best_score); - av_frame_make_writable(in); - av_dict_set_int(&in->metadata, "lavfi.rect.w", foc->obj_frame->width, 0); av_dict_set_int(&in->metadata, "lavfi.rect.h", foc->obj_frame->height, 0); av_dict_set_int(&in->metadata, "lavfi.rect.x", best_x, 0);