OSDN Git Service

movenc: Include empty tracks in iods when writing fragmented mp4
authorMartin Storsjö <martin@martin.st>
Mon, 3 Nov 2014 21:44:02 +0000 (23:44 +0200)
committerMartin Storsjö <martin@martin.st>
Mon, 17 Nov 2014 14:12:02 +0000 (16:12 +0200)
When writing fragmented streams with an empty initial moov,
we won't have any samples in any tracks when writing the
moov atom, thus trust that any tracks that are added actually
will be present.

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

index fa5fdad..359716d 100644 (file)
@@ -1809,7 +1809,7 @@ static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov)
     int audio_profile = mov->iods_audio_profile;
     int video_profile = mov->iods_video_profile;
     for (i = 0; i < mov->nb_streams; i++) {
-        if (mov->tracks[i].entry > 0) {
+        if (mov->tracks[i].entry > 0 || mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {
             has_audio |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_AUDIO;
             has_video |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_VIDEO;
         }