From patchwork Fri Nov 19 19:16:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31509 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp2862492iob; Fri, 19 Nov 2021 11:17:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFt/bXy+c3DuSSjfnLSQTLEukRqGHKYEZvZpJ4y4AWnZUS9Fy0QeFaGTwLqR0A516bxaGB X-Received: by 2002:a17:907:9607:: with SMTP id gb7mr11000912ejc.441.1637349440334; Fri, 19 Nov 2021 11:17:20 -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 z7si1830102edb.427.2021.11.19.11.17.19; Fri, 19 Nov 2021 11:17:20 -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=FOOQmlSE; 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 5C21C68A6E7; Fri, 19 Nov 2021 21:17:13 +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-oln040092070048.outbound.protection.outlook.com [40.92.70.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3147E68A764 for ; Fri, 19 Nov 2021 21:17:06 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q+4jg45QrPAqJyeWEIuzlQX02TboQEnof3BKuKg6KrijxxqHY2DRkwEzTb8IX0xROErwJv3eSHr8YQro3C0cRHLPgnrehJS193q+FCtpMzrqgw9u0yP450CoObFRG1gCr0ViEnQ/k4uR7EC+9M0MWiHMtzCK+Q7H0bE9JfFYUQML+7QkvRplYofGhuCby9oTkSLik3kjJ0SaKGjo76qfKcqqhtnliByumiE9HwOX0pV14WrV2nfkHnuliGyCTPAs2uFxFR7pCqzl2JbnrcTPPUzHmRn/7341Ec+0Vs/q9dAo9MjgoSenkco81Pl9/p25yXM84kPvizgszqnmv82Rbg== 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=vkfm8hLo8OnDqSLng0umpatYbCFtoOVpunBGi1scwls=; b=Q895ztVapGKdaP9guSUwQhgoE88jxN/AozPjNnKWKvEtSu/jjB4YPyojut7c4sqW5kSWiNbIfpB0nqSMouv777wWDIm6GR40L7A4Gthafb+ZKTf88JPQ6VOfvVYTYzFP8owsFXXOYhy97EB7gRLlLsH6OfLWQZHTaZYiUDxZhKqprKkrz7hBVveWZaj5To9ns1WSMoCxRooCeAoxFktFK7IXL2HpSFU4NGflg+7VZLxS6v9/1naeKQiMBZoM+UckfNK7Z0xs+Jr4vApVD82viidj7+SqNWMSj16eLolDDiz4VjrwUN7mVfQ3AVF6Gg3OyZuZ1uXvK4ve2jWhdxaF7A== 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=vkfm8hLo8OnDqSLng0umpatYbCFtoOVpunBGi1scwls=; b=FOOQmlSEunB+rZdte7q2JUpmOY7zLCOIOZjEk69YyyWmmH61ilg7YL4/TLViRKXh0obeH8wpGgtXyg0OYNt8gjh9RIRSFPPST0sZhDUOMy+Z3YA7LLhnoP+fvRg3tNdvR22K+Zg2XN2asrK7Lj1uvMpZNE0sc4I56rI6qkHQc/MJl39WITa8mBOWzVc8AqVEY3UEOER6nKggsjoQo2Kqm8eDzNaNnM+25huTMkqXU6HTFGSj+qnUKP3QJFy0GEygXBKNlgnUDIs2HjMZVTm0K8yfpPFsWVCp7l/wzVJpraLMAwRL8ANoD2V7By0Ct3X+YjLvBSIuieE8BZGr75VE4w== 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: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.4713.022; Fri, 19 Nov 2021 19:17:04 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Nov 2021 20:16:50 +0100 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [QZMIlD6JzqUJSyKphaWMJEzvtvZ672yS] 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-2-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:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cb1dc6cb-c8b2-42d3-3332-08d9ab912bd7 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNUlUbzXBDZtlJsbJd/SSpZPTVD+cqRgdh19Xu37fk+E1wsCh78s+Xo9RwA6LYe3krcCnMjPK8csY42XzCr9nznfEEFJbhllnskR/ngN6/wAaGvENy6sbxN7kxTUP5CqdGbHCcFp2cxV8Jpvte1FnREeB+uthPtH6G+jEUK+KFbEY2PiIw8M+XuggMyM8A5sZTv2+ce3+13fFpvQn3ivfkxAV92GZwJ1XdKrxIuCjVBBTzQldVCKXRcpo637tQlJB5Ysh6NFVXad8//1Fp3/a+6Wg3yAwGldyCpraxqSc8ENVX6OFPU+bAggIb30yYlMmtOSGj6KnvBZxWoGgrNC2GSwH4+DZxCnSQUYFrd2utcEYZSeDVOxlyiz5PEF8pbTyd/OJVJwlxkoIx6Gm6VRsP9iP0Tp0GY5kpYIvG4yU1e7CWa4+TI+vTtgnauY+W9ZGvKy0GvatUgn9uyOG6gFkG1mTMVIpTia03e3ieGSiPyEIDStgZUi1SbvCNaxKGkVhaRExigEq0oIdKCfeoAzo1IGA9NFvRhmBvZVQRIApGDBEysQAMf4zA7U7CDkXB6ozL1ystHV2RNUDMdZQ0zX5M21CMSOqbXytFt2ip7fkoh/0g7j2apk+gHf0J7o4VQ6ggZANtRp3u/g95y0eFswpnA1cD15yZj/8m6P32Y4D++qE6csfZLyvb0IiaSLEmk2Y18+E+B0y+yzKQwJ3+f64rTY+AusPBb/uKw= X-MS-TrafficTypeDiagnostic: AM6PR0302MB3317: X-Microsoft-Antispam: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I6W+4Sk/yRAOnFxDMA/tVA5B8JCpVwFDnTpF4caRK4BwLYinFMzffk73XqdmH8MshBhPVMJ7IbGmNQ266y5wgi6nynlxhF3j39D/6S9VaAzisv/LWRSFe3pbFlKWnA2Dyt5i7RofhY8v5CwEuJgkX3xdSbay6RHirrDcrZxt1dJnyEY2AtOppR93/FGq2PiR5u1K1iMQ4ZXW8+czVKSvFEcU2PQ9srpVdd/dWrDW523tJ6j9exTB4KuZfoL6jMpzItTxMw9FgQmD1ILMxgA1jA6wipOF2BfWcW5ldnriZtjmWz3BfGObSrySsZpNHQihKVw1zEPw6CyoiHTf1V+BD7egBK0UapSkuZg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb1dc6cb-c8b2-42d3-3332-08d9ab912bd7 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:04.5937 (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 3/5] avformat/movenc: 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: 9mK2Q3d972RZ Signed-off-by: Andreas Rheinhardt --- libavformat/movenc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index fec467979a..caccf18dea 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6458,8 +6458,6 @@ static void mov_free(AVFormatContext *s) MOVMuxContext *mov = s->priv_data; int i; - av_packet_free(&mov->pkt); - if (!mov->tracks) return; @@ -6569,6 +6567,7 @@ static int mov_init(AVFormatContext *s) int i, ret; mov->fc = s; + mov->pkt = ffformatcontext(s)->pkt; /* Default mode == MP4 */ mov->mode = MODE_MP4; @@ -6714,10 +6713,6 @@ static int mov_init(AVFormatContext *s) mov->nb_streams += mov->nb_meta_tmcd; } - mov->pkt = av_packet_alloc(); - if (!mov->pkt) - return AVERROR(ENOMEM); - // Reserve an extra stream for chapters for the case where chapters // are written in the trailer mov->tracks = av_calloc(mov->nb_streams + 1, sizeof(*mov->tracks));