From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 13/13] avformat: Make init function out of write_header functions if possible
Date: Wed, 20 Mar 2024 03:12:56 +0100
Message-ID: <AS8P250MB07440DA2EE5BEB2FA411BDB68F332@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB07447D5624C9B5EA91D18ED18F332@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>
Also mark them as av_cold while just at it.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
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,
};
--
2.40.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-03-20 2:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 2:07 [FFmpeg-devel] [PATCH 01/13] avformat/mp3enc: Improve query_codec Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 02/13] libavformat/westwood_audenc: Use proper logcontext Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 03/13] avformat/mux: Rename FF_FMT_ALLOW_FLUSH->FF_OFMT_FLAG_ALLOW_FLUSH Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 04/13] avformat/codec2: Don't allocate Codec2Context for muxer Andreas Rheinhardt
2024-03-20 11:23 ` Tomas Härdin
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 05/13] avformat/amr: Move write_header closer to muxer definition Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 06/13] avformat/mux_utils: Don't report that AV_CODEC_ID_NONE can be muxed Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 07/13] fate/filter-audio: Don't use pcm output for channelsplit test Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 08/13] avformat/mux: Add flag for "not more than one stream of each type" Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 09/13] avformat: Enforce one-stream limit where appropriate Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 10/13] avformat/mux: Add flag for "only default codecs allowed" Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 11/13] avformat/ttmlenc: Avoid unnecessary block Andreas Rheinhardt
2024-03-20 2:12 ` [FFmpeg-devel] [PATCH 12/13] avformat: Enforce codec_id where appropriate Andreas Rheinhardt
2024-03-20 2:12 ` Andreas Rheinhardt [this message]
2024-03-22 12:13 ` [FFmpeg-devel] [PATCH 01/13] avformat/mp3enc: Improve query_codec Andreas Rheinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AS8P250MB07440DA2EE5BEB2FA411BDB68F332@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git