[FFmpeg-devel] [PATCH] lavf: always call avio_flush in av_write_trailer.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Apr 10 21:38:06 CEST 2012


Otherwise for muxers like e.g. latmenc that never call
avio_flush (and do not have a write_trailer function)
a part of the data will always be missing.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavformat/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index ebf34de..dd3108f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3567,6 +3567,8 @@ int av_write_trailer(AVFormatContext *s)
     if(s->oformat->write_trailer)
         ret = s->oformat->write_trailer(s);
 fail:
+    if (s->pb)
+       avio_flush(s->pb);
     if(ret == 0)
        ret = s->pb ? s->pb->error : 0;
     for(i=0;i<s->nb_streams;i++) {
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list