From f7b240434c015056bc6319ddbdb8483757cc13e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 2 Oct 2012 23:51:46 +0200 Subject: [PATCH] segment: Set the resend_headers flag for each segment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes sure new inline headers are emitted when the next packet is written. This allows segmenting mpegts without calling write_header/write_trailer (nor freeing/reiniting the muxer) for each segment. Signed-off-by: Martin Storsjö --- libavformat/segment.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/segment.c b/libavformat/segment.c index 53b8a239b5..bdb5254de4 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -96,6 +96,9 @@ static int segment_start(AVFormatContext *s, int write_header) &s->interrupt_callback, NULL)) < 0) return err; + if (oc->oformat->priv_class && oc->priv_data) + av_opt_set(oc->priv_data, "resend_headers", "1", 0); + if (write_header) { if ((err = avformat_write_header(oc, NULL)) < 0) return err;