diff mbox series

[FFmpeg-devel,v2,4/4] avformat/tee: relay programs to child muxers

Message ID 20230209105519.1814-4-ffmpeg@gyani.pro
State New
Headers show
Series [FFmpeg-devel,v2,1/4] avformat: add av_program_copy() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Gyan Doshi Feb. 9, 2023, 10:55 a.m. UTC
---
 libavformat/tee.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/tee.c b/libavformat/tee.c
index dd408dd096..2fde8a3828 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -291,6 +291,12 @@  static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
         }
     }
 
+    for (i = 0; i < avf->nb_programs; i++) {
+        ret = av_program_copy(avf2, avf, avf->programs[i]->id, 0);
+        if (ret < 0)
+            av_log(avf, AV_LOG_WARNING, "unable to transfer program %d to child muxer\n", avf->programs[i]->id);
+    }
+
     ret = ff_format_output_open(avf2, filename, &options);
     if (ret < 0) {
         av_log(avf, AV_LOG_ERROR, "Slave '%s': error opening: %s\n", slave,