OSDN Git Service

movenc: Automatically flush after writing the initial moov
authorMartin Storsjö <martin@martin.st>
Fri, 6 Nov 2015 23:18:05 +0000 (01:18 +0200)
committerMartin Storsjö <martin@martin.st>
Tue, 10 Nov 2015 19:46:03 +0000 (21:46 +0200)
In most other cases when writing fragmented mp4 files, the output
IO context is flushed after each fragment. Also flush it after
writing the initial moov, to have it behave in the same way.

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

index 572e781..3ee54bf 100644 (file)
@@ -4048,6 +4048,7 @@ static int mov_write_header(AVFormatContext *s)
     if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV &&
         !(mov->flags & FF_MOV_FLAG_DELAY_MOOV)) {
         mov_write_moov_tag(pb, mov, s);
+        avio_flush(pb);
         mov->moov_written = 1;
         if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX)
             mov->reserved_header_pos = avio_tell(pb);