segment: Set the resend_headers flag for each segment

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>
This commit is contained in:
Martin Storsjö 2012-10-02 23:51:46 +02:00
parent 378a6315b7
commit f7b240434c
1 changed files with 3 additions and 0 deletions

View 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;