[FFmpeg-devel] [PATCH v3 5/5] avformat/tee: relay programs to child muxers

Gyan Doshi ffmpeg at gyani.pro
Fri Feb 17 19:02:49 EET 2023


---
 libavformat/tee.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/tee.c b/libavformat/tee.c
index cb555f52fd..a917cb0244 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -295,6 +295,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
         }
     }
 
+    for (i = 0; i < avf->nb_programs; i++) {
+        ret = av_program_copy(avf2, (const AVFormatContext *)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);
+            break;
+        }
+    }
+
     ret = ff_format_output_open(avf2, filename, &options);
     if (ret < 0) {
         av_log(avf, AV_LOG_ERROR, "Slave '%s': error opening: %s\n", slave,
-- 
2.39.1



More information about the ffmpeg-devel mailing list