[FFmpeg-devel] [PATCH v2 3/4] avformat/segment: relay programs to child muxers

Gyan Doshi ffmpeg at gyani.pro
Thu Feb 9 12:55:18 EET 2023


---
 libavformat/segment.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 80e4bf851c..2d9f24e194 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -182,6 +182,12 @@ static int segment_mux_init(AVFormatContext *s)
         }
     }
 
+    for (i = 0; i < s->nb_programs; i++) {
+        ret = av_program_copy(oc, s, s->programs[i]->id, 0);
+        if (ret < 0)
+            av_log(s, AV_LOG_WARNING, "unable to transfer program %d to child muxer\n", s->programs[i]->id);
+    }
+
     return 0;
 }
 
-- 
2.39.1



More information about the ffmpeg-devel mailing list