segment: Flush buffered data before finishing a segment
authorMartin Storsjö <martin@martin.st>
Tue, 2 Oct 2012 21:56:40 +0000 (23:56 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 4 Oct 2012 10:52:09 +0000 (13:52 +0300)
This makes sure any buffered data is written to the segment, for
muxers that buffer up data internally (e.g. fragmented mp4).

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/segment.c

index bdb5254..fb5a22e 100644 (file)
@@ -111,6 +111,7 @@ static int segment_end(AVFormatContext *oc, int write_trailer)
 {
     int ret = 0;
 
+    av_write_frame(oc, NULL); /* Flush any buffered data */
     if (write_trailer)
         av_write_trailer(oc);
     avio_close(oc->pb);