avformat/segment: Fix header_filename handling
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 Feb 2016 16:59:58 +0000 (17:59 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 Feb 2016 16:59:58 +0000 (17:59 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/segment.c

index f6df175..dd3b092 100644 (file)
@@ -701,7 +701,9 @@ static int seg_write_header(AVFormatContext *s)
         goto fail;
 
     if (seg->write_header_trailer) {
-        if ((ret = s->io_open(s, &oc->pb, oc->filename, AVIO_FLAG_WRITE, NULL)) < 0) {
+        if ((ret = s->io_open(s, &oc->pb,
+                              seg->header_filename ? seg->header_filename : oc->filename,
+                              AVIO_FLAG_WRITE, NULL)) < 0) {
             av_log(s, AV_LOG_ERROR, "Failed to open segment '%s'\n", oc->filename);
             goto fail;
         }