Flush the buffer after writing the header and when done with writing the files
authorDavid Conrad <lessen42@gmail.com>
Sat, 17 Jan 2009 04:30:36 +0000 (04:30 +0000)
committerDavid Conrad <lessen42@gmail.com>
Sat, 17 Jan 2009 04:30:36 +0000 (04:30 +0000)
Fixes writing small (~4kb) files.

Originally committed as revision 16650 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/matroskaenc.c

index a6435d1..59016ca 100644 (file)
@@ -708,6 +708,7 @@ static int mkv_write_header(AVFormatContext *s)
     if (mkv->cues == NULL)
         return AVERROR(ENOMEM);
 
+    put_flush_packet(pb);
     return 0;
 }
 
@@ -888,6 +889,7 @@ static int mkv_write_trailer(AVFormatContext *s)
 
     end_ebml_master(pb, mkv->segment);
     av_free(mkv->md5_ctx);
+    put_flush_packet(pb);
     return 0;
 }