segment: Set the resend_headers flag for each segment
authorMartin Storsjö <martin@martin.st>
Tue, 2 Oct 2012 21:51:46 +0000 (23:51 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 4 Oct 2012 10:52:09 +0000 (13:52 +0300)
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ö <martin@martin.st>
libavformat/segment.c

index 53b8a23..bdb5254 100644 (file)
@@ -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;