aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-02 15:06:44 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-07 00:39:11 +0200
commit5869407da2657900ebf7419a4dff85b309e2363e (patch)
tree740d68d586a7807bb55acd6f083688e88aeb3dc0 /libavformat/mux.c
parent8238bc0b5e3dba271217b1223a901b3f9713dc6e (diff)
downloadffmpeg-5869407da2657900ebf7419a4dff85b309e2363e.tar.gz
avformat/mux: Only write HEADER marker if format has .write_header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index fff8094341..0cf9ebfc19 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -464,9 +464,9 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
if ((ret = avformat_init_output(s, options)) < 0)
return ret;
- if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
- avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER);
if (ffofmt(s->oformat)->write_header) {
+ if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
+ avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER);
ret = ffofmt(s->oformat)->write_header(s);
if (ret >= 0 && s->pb && s->pb->error < 0)
ret = s->pb->error;