diff mbox series

[FFmpeg-devel,06/17] avformat/mxfenc: Make init function out of write_header

Message ID AM7PR03MB66603107F6A90107AB9C23DF8F929@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Headers show
Series [FFmpeg-devel,01/17] avformat/mxfenc: Auto-insert h264_mp4toannexb BSF if needed | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 9, 2021, 6:01 p.m. UTC
The MXF muxers only write the header after they have received
a packet; the actual write_header function does not write anything.
So make an init function out of it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/mxfenc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Tomas Härdin Nov. 9, 2021, 9:17 p.m. UTC | #1
tis 2021-11-09 klockan 19:01 +0100 skrev Andreas Rheinhardt:
> The MXF muxers only write the header after they have received
> a packet; the actual write_header function does not write anything.
> So make an init function out of it.

New API being put to good use. Patch looks OK

We could write *some* output if we really wanted to, like the header
partition key and klv fill. Not very useful however.

/Tomas
diff mbox series

Patch

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index fd9e2c4c48..a6535eb43f 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2500,7 +2500,7 @@  static int mxf_init_timecode(AVFormatContext *s, AVStream *st, AVRational tbc)
         return av_timecode_init(&mxf->tc, av_inv_q(tbc), 0, 0, s);
 }
 
-static int mxf_write_header(AVFormatContext *s)
+static int mxf_init(AVFormatContext *s)
 {
     MXFContext *mxf = s->priv_data;
     int i, ret;
@@ -3261,7 +3261,7 @@  const AVOutputFormat ff_mxf_muxer = {
     .priv_data_size    = sizeof(MXFContext),
     .audio_codec       = AV_CODEC_ID_PCM_S16LE,
     .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_header      = mxf_write_header,
+    .init              = mxf_init,
     .check_bitstream   = mxf_check_bitstream,
     .write_packet      = mxf_write_packet,
     .write_trailer     = mxf_write_footer,
@@ -3278,7 +3278,7 @@  const AVOutputFormat ff_mxf_d10_muxer = {
     .priv_data_size    = sizeof(MXFContext),
     .audio_codec       = AV_CODEC_ID_PCM_S16LE,
     .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
-    .write_header      = mxf_write_header,
+    .init              = mxf_init,
     .write_packet      = mxf_write_packet,
     .write_trailer     = mxf_write_footer,
     .deinit            = mxf_deinit,
@@ -3295,7 +3295,7 @@  const AVOutputFormat ff_mxf_opatom_muxer = {
     .priv_data_size    = sizeof(MXFContext),
     .audio_codec       = AV_CODEC_ID_PCM_S16LE,
     .video_codec       = AV_CODEC_ID_DNXHD,
-    .write_header      = mxf_write_header,
+    .init              = mxf_init,
     .check_bitstream   = mxf_check_bitstream,
     .write_packet      = mxf_write_packet,
     .write_trailer     = mxf_write_footer,