summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_mux.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-10-11 13:38:17 +0200
committerAnton Khirnov <anton@khirnov.net>2022-10-18 13:57:42 +0200
commit965bff37b6181b9db248a0deef7e2643d0ef9721 (patch)
tree2b9910ec2c87293f1cffcfa1535ff59317baca1c /fftools/ffmpeg_mux.c
parent731246ae8fbe14beed6c1a361bfb6963c9f59c51 (diff)
downloadffmpeg-965bff37b6181b9db248a0deef7e2643d0ef9721.tar.gz
fftools/ffmpeg: move some stream initialization code to ffmpeg_mux
The code in question is muxing-specific and so belongs there. This will allow make some objects private to the muxer in future commits.
Diffstat (limited to 'fftools/ffmpeg_mux.c')
-rw-r--r--fftools/ffmpeg_mux.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index 63f63c0852..7bc25c6175 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -516,8 +516,7 @@ fail:
return ret;
}
-/* open the muxer when all the streams are initialized */
-int of_check_init(OutputFile *of)
+static int mux_check_init(OutputFile *of)
{
AVFormatContext *fc = of->mux->fc;
int ret, i;
@@ -565,6 +564,16 @@ int of_check_init(OutputFile *of)
return 0;
}
+int of_stream_init(OutputFile *of, OutputStream *ost)
+{
+ if (ost->sq_idx_mux >= 0)
+ sq_set_tb(of->sq_mux, ost->sq_idx_mux, ost->mux_timebase);
+
+ ost->initialized = 1;
+
+ return mux_check_init(of);
+}
+
int of_write_trailer(OutputFile *of)
{
AVFormatContext *fc = of->mux->fc;
@@ -710,7 +719,7 @@ int of_muxer_init(OutputFile *of, AVFormatContext *fc,
/* write the header for files with no streams */
if (of->format->flags & AVFMT_NOSTREAMS && fc->nb_streams == 0) {
- ret = of_check_init(of);
+ ret = mux_check_init(of);
if (ret < 0)
goto fail;
}