OSDN Git Service

movenc: Remove an unnecessary condition when flushing fragments
authorMartin Storsjö <martin@martin.st>
Thu, 18 Dec 2014 21:59:27 +0000 (23:59 +0200)
committerMartin Storsjö <martin@martin.st>
Fri, 2 Jan 2015 23:18:38 +0000 (01:18 +0200)
If fragments == 0 it means we haven't written any moov atom yet.
If the empty_moov flag is set, we already have written an empty moov
atom at startup. Thus, the check for empty_moov is redundant.

This is in preparation for allowing writing the moov atom later,
even when using the empty moov flag.

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

index 3f5a6ae..fe5f5ed 100644 (file)
@@ -3089,7 +3089,7 @@ static int mov_flush_fragment(AVFormatContext *s)
     if (!(mov->flags & FF_MOV_FLAG_FRAGMENT))
         return 0;
 
-    if (!(mov->flags & FF_MOV_FLAG_EMPTY_MOOV) && mov->fragments == 0) {
+    if (mov->fragments == 0) {
         int64_t pos = avio_tell(s->pb);
         int ret;
         AVIOContext *moov_buf;