segment: Flush buffered data before finishing a segment

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>
This commit is contained in:
Martin Storsjö 2012-10-02 23:56:40 +02:00
parent f7b240434c
commit a854362b40

View File

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