[FFmpeg-cvslog] avformat/mux: do not call write_packet with a flush packet if header is not written
Marton Balint
git at videolan.org
Mon Jun 20 00:30:53 CEST 2016
ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sat Jun 11 20:25:58 2016 +0200| [e07b8d68f5ee7da3a0f4c5b9063b928d7c35a9a9] | committer: Marton Balint
avformat/mux: do not call write_packet with a flush packet if header is not written
Signed-off-by: Marton Balint <cus at passwd.hu>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e07b8d68f5ee7da3a0f4c5b9063b928d7c35a9a9
---
libavformat/mux.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavformat/mux.c b/libavformat/mux.c
index b1b65a1..f21b4dd 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -823,6 +823,11 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt)
if (!pkt) {
if (s->oformat->flags & AVFMT_ALLOW_FLUSH) {
+ if (!s->internal->header_written) {
+ ret = s->internal->write_header_ret ? s->internal->write_header_ret : write_header_internal(s);
+ if (ret < 0)
+ return ret;
+ }
ret = s->oformat->write_packet(s, NULL);
if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
avio_flush(s->pb);
More information about the ffmpeg-cvslog
mailing list