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

Reimar Döffinger git at videolan.org
Thu Apr 12 00:14:16 CEST 2012


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Tue Apr 10 21:36:30 2012 +0200| [277f20c3c877a74aca9d480480024a6d66c9fbc4] | committer: Reimar Döffinger

lavf: always call avio_flush in av_write_trailer.

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.
Also update references for the voc muxer, which was also
buggy before and did not write out all data.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=277f20c3c877a74aca9d480480024a6d66c9fbc4
---

 libavformat/utils.c    |    2 ++
 tests/ref/lavf/voc     |    6 +++---
 tests/ref/lavf/voc_s16 |    6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

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++) {
diff --git a/tests/ref/lavf/voc b/tests/ref/lavf/voc
index 25e8b44..ea903b6 100644
--- a/tests/ref/lavf/voc
+++ b/tests/ref/lavf/voc
@@ -1,3 +1,3 @@
-b0bc287ce4e3eef7c1012610dd7ff6d0 *./tests/data/lavf/lavf.voc
-32768 ./tests/data/lavf/lavf.voc
-./tests/data/lavf/lavf.voc CRC=0xa2d77c12
+5c4ee01048e7a8a138a97e80cf7a1924 *./tests/data/lavf/lavf.voc
+45261 ./tests/data/lavf/lavf.voc
+./tests/data/lavf/lavf.voc CRC=0x74b2b546
diff --git a/tests/ref/lavf/voc_s16 b/tests/ref/lavf/voc_s16
index 425d965..d53c950 100644
--- a/tests/ref/lavf/voc_s16
+++ b/tests/ref/lavf/voc_s16
@@ -1,3 +1,3 @@
-b20728bf036d2e23508869acbad4e576 *./tests/data/lavf/lavf.s16.voc
-163840 ./tests/data/lavf/lavf.s16.voc
-./tests/data/lavf/lavf.s16.voc CRC=0xfa9b6c39
+8ed10b311e49b4d4b18679b126492159 *./tests/data/lavf/lavf.s16.voc
+180437 ./tests/data/lavf/lavf.s16.voc
+./tests/data/lavf/lavf.s16.voc CRC=0x7bd585ff



More information about the ffmpeg-cvslog mailing list