summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_mux.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-12-11 14:33:26 +0100
committerAnton Khirnov <anton@khirnov.net>2022-07-23 11:53:19 +0200
commitcc4964607724980aae242777af9b35567b2fc627 (patch)
tree7eb399ece6e5e96755a2ee5a13e5d57bff07f80c /fftools/ffmpeg_mux.c
parent12e9e50219e60bb5d15bc77f57572274d0ca8a46 (diff)
fftools/ffmpeg: write the header for stream-less outputs when initializing the muxer
There is no reason to delay this.
Diffstat (limited to 'fftools/ffmpeg_mux.c')
-rw-r--r--fftools/ffmpeg_mux.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index db04b7858d..396e91184b 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -340,6 +340,13 @@ int of_muxer_init(OutputFile *of, int64_t limit_filesize)
if (strcmp(of->format->name, "rtp"))
want_sdp = 0;
+ /* write the header for files with no streams */
+ if (of->format->flags & AVFMT_NOSTREAMS && of->ctx->nb_streams == 0) {
+ int ret = of_check_init(of);
+ if (ret < 0)
+ return ret;
+ }
+
return 0;
}