From 21b459e4bbfc14fd1ec9076e3a0b01f6f11ba960 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 10 Feb 2016 17:59:58 +0100 Subject: [PATCH] avformat/segment: Fix header_filename handling Signed-off-by: Michael Niedermayer --- libavformat/segment.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }