From patchwork Fri Nov 19 19:16:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31505 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp2862697iob; Fri, 19 Nov 2021 11:17:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxh/MdP2CPkHVc/dtZbMRdPdpRbR1h0LC3uUkytw3NDrt9hxEaHXi/0zQIALBSvukjroKLM X-Received: by 2002:a05:6402:168a:: with SMTP id a10mr29089387edv.219.1637349450909; Fri, 19 Nov 2021 11:17:30 -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 hg2si1921589ejc.416.2021.11.19.11.17.30; Fri, 19 Nov 2021 11:17:30 -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=V4Pc33iu; 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 7FB4468A132; Fri, 19 Nov 2021 21:17:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-oln040092070084.outbound.protection.outlook.com [40.92.70.84]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C0BE68A132 for ; Fri, 19 Nov 2021 21:17:14 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NuL8AaO7o06O603F1rvzDNcbP3PCIEQLxJRyQXFJZ2tFQJBFgSrNUBWNQzt13KfCtjD/9zQFN3Mie0Q8Wn+RGW50tVKFUlSVbkf3dQoPp9QqIM++b6iWrsxko+/IMxYIyk0ugJRYh2+p/JiVTV0iza5g44BFpJbbpq9Ddj1GHv+4Lkl0pA9bQKaGAHRAVsv1D0VeRll0fYM0BWZLhAuIrjYgEhSVTHrlLrDUwpmBsuargLa98VkMeQ0RQwijFglPB/O5dDIXdBHlBx8FHRB+C1/YplQpnWJ50vvT0wEqpZ5hxcjUq9Z5Mf1eFKDlbFSlijvCrBduCf2UITcT5q1X5g== 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=lHHdL8HKulDQtfDn1EqFw9b8zpNGO0B4cn1iHAVePwE=; b=REyWztpVMKWG5L8ZB9kQLnqLEig585gIxX8lNPsSI8K5f2ROFkrrx7OB3olKFX4D4oTQ6YWl6i66YIyj/MDFMWpSOBYt24f2hC04pymFrf+Sxa0mjYmHZe6+YmBhh1aXND5fPM6gMbdRNCewy8RVby5bntFNWH+Vbnk8Wyw4qV1NLEdgn7TBQSSuZqi4mePY2YCaa0CF8CrgVv/OkPWgoHx6TsxgcPLpjetJyyt0I7sotzovEwYpBCXOr58VqeNGcE0THQhEvLJ9SoNppAOZzXPzxlrDGOTVNW00D6VK1kqs5BukTJgNrBgX+KF1t7FDRC1PdbqcqXr7mGhWU7bUJg== 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=lHHdL8HKulDQtfDn1EqFw9b8zpNGO0B4cn1iHAVePwE=; b=V4Pc33iuj+95M+BWLE/DKS4XWXQtrUkBzjFR5pQr0s3XNJVJNWwGSuTR0fQ/nFptsZIzCcMqb1M5XVhf/e2kivhz4rSGuGBOmi3avqFsNjI5DOR5ejO8q0FacV5TD1d+NJO/8df8sRgvymKw0V1OdN8auCf/W/o2xMC6eKMe/Sdt/GgGxu8Qu2Fv8+85A70dZuvlbceyF7rprI4f4im4RaIIXvSmKZDT+73W+0KWqExNNA4MK7Ha/WFq0jfNVoi76ki6QediW13AlS9bAQhlQz2hfi/xCFgUR94THNd8i9KHeCT3+8B7QGCd0sK1Eo9m6TFf9HMNKVFFmRQa/4Fgog== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR0302MB3317.eurprd03.prod.outlook.com (2603:10a6:209:25::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Fri, 19 Nov 2021 19:17: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.4713.022; Fri, 19 Nov 2021 19:17:12 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Nov 2021 20:16:51 +0100 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [T6RQwHYZEGW+5vwwcnl14RcrAQofJHiw] X-ClientProxiedBy: AM0PR08CA0001.eurprd08.prod.outlook.com (2603:10a6:208:d2::14) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211119191652.1025931-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.137.12) by AM0PR08CA0001.eurprd08.prod.outlook.com (2603:10a6:208:d2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Fri, 19 Nov 2021 19:17:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e00f082a-92e4-4024-3f12-08d9ab91309f X-MS-Exchange-SLBlob-MailProps: q+fD6XS3/UKE76TYhWV/4GPn/ptmlETwonHvn8OEIrv+eT94ib/BbWgsLutpRK3PSNjve2fLSuzt0fhPLHRiCAbP6NcAQeRCq7HSwWxakJ0YtfJV1PCk00ABa96li6/zVALqdLHDIhpEKWKlVFu3/6S1aBibe2WcG5Xu4YYvSGvHy7gwzS7+cfPY11Jr38gArz5jDuX1fbR7wmw9C02zY4NimLUElXh4Uwc9meqTamRJ9ohSGzgoZS9Ddv5IJzLkQ9Cf9CzKIXH2UwjKb0VKPiJgAFNmytL2PuPWoh65Oa90FGYXlLG4oOz5/iQHJjqyotbhV9WUb2VtIC/CtQLj2EYF+xI9k48QAbUlB6NmyH/QUYIa7PZcoUFRVQa8XUH9Z7vV77Z3XKuI9Cv3gGfuqEI1eEWd5cgkh1aFRS+f5ONQoN8jRyZhZvSYHsivJPrvOJViPu5fSP7xgHMzYIOckQAxrmUAU8htJ7BYm0IasuNj8xrrEChmom+ZzfpLnlOIdXzkyzPBprSZXDpXXGgzgM50WsZanETVSRpXIl1zUj40ut8TkTxU1RARktqZ0jqDpnev8z5sZDq9XZAEDRTaaPVCGOt1Ih21l04B89ZHr90kUtu+6GwK1riZYbYi16kmFU9P59dZVr2TfYBHL90gzFtQMHlL/7dMwzFNcbP7WsvNrKrGBcPGVDN7I7SilOVckhjug1osUN50IcDKcT/AVw== X-MS-TrafficTypeDiagnostic: AM6PR0302MB3317: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mvx4IoK151rlRlpgDMDvqmULUT4XONz9uWtUP2IZwVQHogbHVrUrL94SPHR0hcX1r3LGJv2GgJl2iUtlgB/8NqJWd47eEzfSf7q8OchzYFE4yy1rh0MuMLF7DeB6Ju49BatXYw2ocbj1nQHbWzk8kakZLHD10rTDxhJJha3EkbELlBz+KI+pA81FpQyvIhEvrITGvxSXmtI1ndb30tuduALP9U4j6tRZcJ5KlrfIz4CbaCHY4rl41xiKSbub7Qxg7pAv7HkR7Uv3H7h5WIjJf3GznSMIZwLYxmdj0WqT2WoCv216nolRfxeBw+DYPqD4evPRpByBZPDYVJ5aJSG6EV/7i0cuQJOvOr8DuOclHVmqWnlqv4REatvLPBBGPWRWkRmFvQGVdR65sQ770ewMEu+fNkQD2c/zPPeFiHGu7Y/iuu4DtIYOq0la3zU6BwVkVIfrAhsQBjlC79OnKnNraW0QatJ6hyjR+8ZfNdGMSgzNsOnfO3nW+Jy/B98ZpcQ2xRkMiRxPjkmS1bdv9lSttzSEMbmajE3O6ONo0/15to/cAof68rTQHhqAhOEd/a/NSZJBL+cBFy6bgHsxaQVvJA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TsFkGBSFT7kV0kEvRTIfwigWp5OcdQS9XBZyZ7Ic2InF8deGlJUwo2EBy2YJJZXYV+Gcz88XuS2MmF2I5bJXmXhw68yvZGobCrOhWlbO+6/YfUX7BkX95eTTk/wVtgvGQpSjk7FDvoN7m2pX7eh+eYOyYub+D2gE6NQhKQCBEMvgvWPYBX0n17s0w9+yZXBYynMAUbz7NfhKJJkagpqSQpPX3qH6kESgFXK7iWVUcHGZa5W0e8+COnbP7kQUIaFuaurLP3ldHHtan/YX/xa8BmQMLahvncFOTyOERp9nVgGqPhSNU+ou44SbiHBHQEmxv0Bdh44flQ33Owy1xzb/Id+tt/L7LteGScSrYdGhCX769uWJ43pyO69E9X8gHSkkBOI6DMMUUGbW4PME9idH5TH9hHKTLlzlNp5X43pqqoEq0INoUjmOlEBK9s8Oes28qMyQYlIa5sXek7te8fJD2NfXb35mM6BYHuVkXMmyHoFQRQ3uPejRvs9KeWoOwyeSnFc8O0Zh36LqeYPoxTiWyTrxCSY1TX0HKqobtCYI21nwCKI6Ww9WWqe7WpXoLEBUm+CHtuNWbd9tZdxijg7neA4+tMcmOyL7ZqE51u0asRWTEDro8V0+tyNmEteYcEV5mxY0eb9aXN3l+ZsPBFkVh3zL8TUPOGWdEGig8AMpZiHD9OLBttKKBuWWU92uN3AFxaRUy6ONpvj1YVLsDNJ1rQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e00f082a-92e4-4024-3f12-08d9ab91309f X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2021 19:17:12.6246 (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: AM6PR0302MB3317 Subject: [FFmpeg-devel] [PATCH 4/5] avformat/mpegtsenc: Avoid allocation of AVPacket 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: taNIjk3isfn4 Signed-off-by: Andreas Rheinhardt --- libavformat/mpegtsenc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 79ec1a7e5f..92b4cc8087 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -1140,9 +1140,7 @@ static int mpegts_init(AVFormatContext *s) ts->nit.write_packet = section_write_packet; ts->nit.opaque = s; - ts->pkt = av_packet_alloc(); - if (!ts->pkt) - return AVERROR(ENOMEM); + ts->pkt = ffformatcontext(s)->pkt; /* assign pids to each stream */ for (i = 0; i < s->nb_streams; i++) { @@ -2186,8 +2184,6 @@ static void mpegts_deinit(AVFormatContext *s) MpegTSService *service; int i; - av_packet_free(&ts->pkt); - for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; MpegTSWriteStream *ts_st = st->priv_data;