[12/14] movenc: Check start_dts instead of track->entry to see whether all streams have been initialized

Message ID 1419862828-30060-12-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

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

Comments

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

I'm not entirely sure why this is a separate patch?
Martin Storsjö Dec. 29, 2014, 5:30 p.m. | #2
On Mon, 29 Dec 2014, Derek Buitenhuis wrote:

> On 12/29/2014 2:20 PM, Martin Storsjö wrote:
>> ---
>>  libavformat/movenc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> I'm not entirely sure why this is a separate patch?

Mostly as a preparatory refactoring/cleanup, to reduce the clutter in 
patch 13/14. I could note that in the commit message to clarify it.

// Martin
Derek Buitenhuis Dec. 29, 2014, 5:33 p.m. | #3
On 12/29/2014 5:30 PM, Martin Storsjö wrote:
> Mostly as a preparatory refactoring/cleanup, to reduce the clutter in 
> patch 13/14. I could note that in the commit message to clarify it.

Sure.

- Derek

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 27421ba..342679e 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3112,7 +3112,7 @@  static int mov_flush_fragment(AVFormatContext *s)
         int buf_size;
 
         for (i = 0; i < mov->nb_streams; i++)
-            if (!mov->tracks[i].entry)
+            if (mov->tracks[i].start_dts == AV_NOPTS_VALUE)
                 break;
         /* Don't write the initial moov unless all tracks have data */
         if (i < mov->nb_streams)