summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/segment.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c
index f6df1759c3..dd3b092139 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -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;
}