提交 6f119dc3 编写于 作者: R Rodger Combs 提交者: Karthick Jeyapal

lavf/dashenc: don't call flush_init_segment before avformat_write_header

Fixes crash when muxing MKV-in-DASH
上级 ab1114a0
...@@ -1026,13 +1026,6 @@ static int dash_init(AVFormatContext *s) ...@@ -1026,13 +1026,6 @@ static int dash_init(AVFormatContext *s)
av_log(s, AV_LOG_VERBOSE, "Representation %d init segment will be written to: %s\n", i, filename); av_log(s, AV_LOG_VERBOSE, "Representation %d init segment will be written to: %s\n", i, filename);
// Flush init segment
// except for mp4, since delay_moov is set and the init segment
// is then flushed after the first packets
if (strcmp(os->format_name, "mp4")) {
flush_init_segment(s, os);
}
s->streams[i]->time_base = st->time_base; s->streams[i]->time_base = st->time_base;
// If the muxer wants to shift timestamps, request to have them shifted // If the muxer wants to shift timestamps, request to have them shifted
// already before being handed to this muxer, so we don't have mismatches // already before being handed to this muxer, so we don't have mismatches
...@@ -1074,6 +1067,13 @@ static int dash_write_header(AVFormatContext *s) ...@@ -1074,6 +1067,13 @@ static int dash_write_header(AVFormatContext *s)
OutputStream *os = &c->streams[i]; OutputStream *os = &c->streams[i];
if ((ret = avformat_write_header(os->ctx, NULL)) < 0) if ((ret = avformat_write_header(os->ctx, NULL)) < 0)
return ret; return ret;
// Flush init segment
// Only for WebM segment, since for mp4 delay_moov is set and
// the init segment is thus flushed after the first packets.
if (strcmp(os->format_name, "mp4") &&
(ret = flush_init_segment(s, os)) < 0)
return ret;
} }
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册