From patchwork Wed Mar 20 02:12:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 47257 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8ba5:b0:1a3:31a3:7958 with SMTP id m37csp121352pzh; Tue, 19 Mar 2024 19:15:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWUmhYu4AWr5gzR8l3FM+u97VaTiIHv6TdS5Yfg1XDk9oHyVsqxoG90/uH43Z6fN7oM0Z9ZoJMiFCM8LJfMjtOlr5h+gRnLbgrWJA== X-Google-Smtp-Source: AGHT+IGCr6xs0+RUljR7Gl9QNzjpzqLIts2+myTlYRsBeU2GlYWbdT8KfYsl1uVzMhdlyKQDYUYb X-Received: by 2002:a17:906:3914:b0:a46:c4c6:38 with SMTP id f20-20020a170906391400b00a46c4c60038mr4070128eje.10.1710900901031; Tue, 19 Mar 2024 19:15:01 -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 lt18-20020a170906fa9200b00a460419e664si5827504ejb.629.2024.03.19.19.15.00; Tue, 19 Mar 2024 19:15:01 -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=OE4T9tSg; 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 9F52E68D472; Wed, 20 Mar 2024 04:14:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03olkn2056.outbound.protection.outlook.com [40.92.59.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6A7AE68D49E for ; Wed, 20 Mar 2024 04:14:16 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y6d/D1w7Hd++F3TB7fg5dpnWrnGeRzY6RDtM3U8FcOUzm2hWoELMkJQZnjL4DQrkVFPMhuzAiVn1KGrW7p/QxX9UMMjnEUEhpl1wPv50qQWLd+Mvgta8H84AOcpQisTbGY1zV4Ax6+j1fdhAbZLQeyFgZDdrI8KQT3EsKLjgrALWDS/O2vcu/OC1faWg2oWo7Ld5VMKs0UUaA2LA+pnoAwavIiZIpXrpa79GiDyESJRsjRBMYixbdU3WX+vgHVzDws/WIpZPLNvkV6Skf64Y1caU/blWa3MxU2fAG3ol/tzTIjZIcgM5TyfykjH6Qo3vqjHvKMnffyVpv/4Xn4VJvg== 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=aXy/RFk+eSlG5h5CQw/RVU8VP4DMdb5dCr2yDbmIXO8=; b=KR5SHh7hCdR7sqBvS0GUg+GWGff0I9xOyw12Bifg+HXIqvWAkWPzM8kS/ysLSKkzhLBlbps2F9tJFSVBtZUgdkTqUrNXXvZ9BA+L2PjeNeHA8nNpe6EzJyYDhfmhef5htL+WgUDrC/+yQEzczLIjTodBR6QDhxUGJOMxo9VjYMtNRp7aMzYzdKYpli14Cf+sy6VB+EpOdCpdhMBT6jdNnpRdulNpLLxiohUQQqE7tQb4W9NytBt73FQjiEB2yjPqVa2CBfyoETtSwilT7ikHO53lF5VJMisChSEwcUj5Z+CXrvermiuiCZuKKQ8fMu1eQg5Sydihrrs9IbPWdMQJwQ== 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=aXy/RFk+eSlG5h5CQw/RVU8VP4DMdb5dCr2yDbmIXO8=; b=OE4T9tSgDxJvjVW1OnSMxREYlRG2XFpQEuitQjj/VJKX6XxFYy8E8e4mODpjEr5oAqD/usbDgUe185Pu2GLDXS3c59ifmTBDlN5QndKNdRApyNpFBPiWts9SgvnAcgWNSQK1P8cEqRdy0GV7VwIbl8L22r2yWExqJgCvsJOS4DxzddyRseOIphR9Qj+XCkmaxs26hCfMCpd1eio2Y2vqJwnDfdQG084l44Ufvf1YoF2WpULlLWt6bISETfTbcQwqkhJCCUgo+vq+m9u9mZopvSJOot+7xvrO7qlilD0tdhUuK7bUe0gNnLjXRBDpxFfXEzLtH6zjOj2tqRa2HRBM4A== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PAXP250MB0543.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:28c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.28; Wed, 20 Mar 2024 02:14:15 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::228d:8c6f:ed10:82eb]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::228d:8c6f:ed10:82eb%7]) with mapi id 15.20.7362.035; Wed, 20 Mar 2024 02:14:15 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 20 Mar 2024 03:12:56 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [E7QSOCK5AiDEzjuRy/NW/QylRfAAP0D/FJ08J3ZB9N8=] X-ClientProxiedBy: ZR0P278CA0062.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::13) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240320021256.107338-12-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PAXP250MB0543:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c5a3d0c-f572-4e90-597e-08dc488370d6 X-MS-Exchange-SLBlob-MailProps: Cq7lScuPrnpHlru1h1vRfamsRCbuNA5UMSCVaUkvMTdey/lq31DjOGORk6VydOSj0hgHGnb0hsqg/yCyUQ8WBNzUgW7cvonTHc+2RpnfcBgPO4BJNF4gi9PbtVumQJs3i+s8FVySnavpavqB8C8wzrLrVPPSSfzVPFcxb9nfxzgX/f/55h0tFY0/FqhWV5IKGUWRI16L26ADHKx2edBPyYsbvVU4fyjsNX0G2y4JhMfBn1R6QQG5Uvt9tAItMMcghzYRQc0v0OfQJKmIEOaHy94qNpbyyRbm6LTrj3nKwkRTHZmoZVfzkmX1yJmo8Rtzp9rEqgUK26TIPuGsCOSqEyS2rMFmjroO7qzrVPhFNGzwOAFzyQ1XovUAHoBe5mnHicPSfBkwbhlY5/dlGYYxmWhE4uYi1jIlabOcSZxLTQdO2Drl/0e6bAMKa/oK0Fwj1VFYPiW06D0ZPHwZdxF3gKMQaivtZ4M5d5BX9RJzopoJ7N7lOubVWhvvSq2rKsDcyoGkQ/T+qZ4ztyq6g3j7tbn4vQT8DquhELz9Mh6BN/1Bmi/XO1FGMoAmFehBroTyNWZ6L//Hf5YmLM3rQTM1mIY/dnK+c+JKe9vyKUIcJc/NRc+14QjSPFP4g65K8gRycUwGheAnxCnfzsEGevKIpFj79G3Ud+OO5zk2BLpRHW01pIUy8yjBy9Lqw5gLc/YhN6C9ryUchC3gdMJ2RtWMLQW3eLYU8R3CVSpxj8dJYkm9v/VsU7TeAVgKnSmTIoYfupRQmUm92yM= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6cN8dEaxgMkZ7MB8WYBvRYJkwNBqSz05RBDQpYD1yvMFOhLx6nShw/kkWsl0d5nU+QYQXqA5KLUkawttfBKCDAuXu7wEjfT3rdy/M7fbPY6h0Sa1129YWvmNHx/gJcl/Viv08BR+HEn5+Ecnq0m2kdZn1LpgeGR5Cf6R88BrcwJrJwe4aVz6BfIAFzBBF1Xwt9Kzgr0O+caFkteA1KBYUtyMGAjPDhnYj2TuVfsqbNGque/Le2vIOTmHMhSGEshutDzxbswwAwnTqSXy/T8VlszqEN8ZmvujkVwC4qd81yFOgFYPws6MKLPJP9y0EBKJtn6sZNzZB0VAnHsRTFytQ9fgco1HDoMD0rk4Sstc2f7FMEYb0GFIP5/tPJC1exbicg8lpe+nl2VDv5uxT6uep2FARdyYfdKTrQXha583bHPF+LITcExQuR0VYw9rXly0mhH3SbpaWvutqpNg03VnJpaKlANzshkqCxRw7bve/quwmekl4wA/ITO94kd//hwzphkn6L+9du3f4kFL8ZXEhY1CXbVpicQn64s2wATLK/aXewTyDeFPlfB8ApkgVJLosSu+vca80sv/dkORz+Jf0VoH33KCEeM9y/HJ/iA3VB+4Y/FO4Mitch7OERxqv7kI X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: z5/1dRIYbocRATx4x0jMe0A4191VuNPUPvOy2wGHPoVl2QNDxL3XoXYjFkO+SwjcaoXs4mjtT5tTKNIEaYpPLA6onmwzoHeMCCIJf3Yl7Ruf9qBJB2UEbYpFgeXmt2jwMl+XKeP8yD1N1pW0JXn7zZjkTDPU62bUvIeHmAcm7eapXtbRC63UXiJKYzfOFkOemjGCBYNMuHgNiNJq+gzpd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QHmum1nm4beujwMv5tdw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c5a3d0c-f572-4e90-597e-08dc488370d6 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2024 02:14:15.2323 (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: PAXP250MB0543 Subject: [FFmpeg-devel] [PATCH 13/13] avformat: Make init function out of write_header functions if possible 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: XJ66XO23AW/o Also mark them as av_cold while just at it. Signed-off-by: Andreas Rheinhardt --- libavformat/bit.c | 4 ++-- libavformat/chromaprint.c | 4 ++-- libavformat/filmstripenc.c | 4 ++-- libavformat/gif.c | 4 ++-- libavformat/supenc.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libavformat/bit.c b/libavformat/bit.c index cd088b87ff..5c3eb31c57 100644 --- a/libavformat/bit.c +++ b/libavformat/bit.c @@ -125,7 +125,7 @@ const FFInputFormat ff_bit_demuxer = { #endif #if CONFIG_BIT_MUXER -static int write_header(AVFormatContext *s) +static av_cold int init(AVFormatContext *s) { AVCodecParameters *par = s->streams[0]->codecpar; @@ -170,7 +170,7 @@ const FFOutputFormat ff_bit_muxer = { .p.subtitle_codec = AV_CODEC_ID_NONE, .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH | FF_OFMT_FLAG_ONLY_DEFAULT_CODECS, - .write_header = write_header, + .init = init, .write_packet = write_packet, }; #endif diff --git a/libavformat/chromaprint.c b/libavformat/chromaprint.c index 4beb75c7a9..1cdca47ea5 100644 --- a/libavformat/chromaprint.c +++ b/libavformat/chromaprint.c @@ -58,7 +58,7 @@ static void deinit(AVFormatContext *s) } } -static int write_header(AVFormatContext *s) +static av_cold int init(AVFormatContext *s) { ChromaprintMuxContext *cpr = s->priv_data; AVStream *st; @@ -181,7 +181,7 @@ const FFOutputFormat ff_chromaprint_muxer = { .p.subtitle_codec = AV_CODEC_ID_NONE, .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH | FF_OFMT_FLAG_ONLY_DEFAULT_CODECS, - .write_header = write_header, + .init = init, .write_packet = write_packet, .write_trailer = write_trailer, .deinit = deinit, diff --git a/libavformat/filmstripenc.c b/libavformat/filmstripenc.c index ec9c814f8c..b5d9179ff3 100644 --- a/libavformat/filmstripenc.c +++ b/libavformat/filmstripenc.c @@ -32,7 +32,7 @@ #define RAND_TAG MKBETAG('R','a','n','d') -static int write_header(AVFormatContext *s) +static av_cold int init(AVFormatContext *s) { if (s->streams[0]->codecpar->format != AV_PIX_FMT_RGBA) { av_log(s, AV_LOG_ERROR, "only AV_PIX_FMT_RGBA is supported\n"); @@ -69,7 +69,7 @@ const FFOutputFormat ff_filmstrip_muxer = { .p.subtitle_codec = AV_CODEC_ID_NONE, .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH | FF_OFMT_FLAG_ONLY_DEFAULT_CODECS, - .write_header = write_header, + .init = init, .write_packet = ff_raw_write_packet, .write_trailer = write_trailer, }; diff --git a/libavformat/gif.c b/libavformat/gif.c index 8264e118c6..211705facc 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -40,7 +40,7 @@ typedef struct GIFContext { AVPacket *prev_pkt; } GIFContext; -static int gif_write_header(AVFormatContext *s) +static av_cold int gif_init(AVFormatContext *s) { avpriv_set_pts_info(s->streams[0], 64, 1, 100); @@ -208,7 +208,7 @@ const FFOutputFormat ff_gif_muxer = { .p.subtitle_codec = AV_CODEC_ID_NONE, .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH | FF_OFMT_FLAG_ONLY_DEFAULT_CODECS, - .write_header = gif_write_header, + .init = gif_init, .write_packet = gif_write_packet, .write_trailer = gif_write_trailer, .p.priv_class = &gif_muxer_class, diff --git a/libavformat/supenc.c b/libavformat/supenc.c index 9d5ca51894..ebdfc7c939 100644 --- a/libavformat/supenc.c +++ b/libavformat/supenc.c @@ -72,7 +72,7 @@ static int sup_write_packet(AVFormatContext *s, AVPacket *pkt) return 0; } -static int sup_write_header(AVFormatContext *s) +static av_cold int sup_init(AVFormatContext *s) { avpriv_set_pts_info(s->streams[0], 32, 1, 90000); @@ -89,6 +89,6 @@ const FFOutputFormat ff_sup_muxer = { .p.subtitle_codec = AV_CODEC_ID_HDMV_PGS_SUBTITLE, .p.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH, - .write_header = sup_write_header, + .init = sup_init, .write_packet = sup_write_packet, };