[03/14] movenc: Remove an unnecessary condition when flushing fragments

Message ID 1419862828-30060-3-git-send-email-martin@martin.st
State Committed
Commit 724cbea7193945fe5a5b4dea8ede344803572844
Headers show

Commit Message

Martin Storsjö Dec. 29, 2014, 2:20 p.m.
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.
---
 libavformat/movenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Derek Buitenhuis Dec. 29, 2014, 5:01 p.m. | #1
On 12/29/2014 2:20 PM, Martin Storsjö wrote:
> 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.
> ---
>  libavformat/movenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

OK.

- Derek

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 3f5a6ae..fe5f5ed 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -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;