]> git.sesse.net Git - ffmpeg/commitdiff
movenc: use the first cluster duration as the tfhd default duration
authorJustin Ruggles <justin.ruggles@gmail.com>
Sun, 26 Feb 2012 22:21:07 +0000 (17:21 -0500)
committerJustin Ruggles <justin.ruggles@gmail.com>
Mon, 27 Feb 2012 09:33:37 +0000 (04:33 -0500)
libavformat/movenc.c

index e2781accbe869ae3c897e85aaa346ea3b8699fc0..a74dd2e6837b31ef867aff297b7c8624ae30df64 100644 (file)
@@ -2215,7 +2215,7 @@ static int mov_write_tfhd_tag(AVIOContext *pb, MOVTrack *track,
     if (flags & MOV_TFHD_BASE_DATA_OFFSET)
         avio_wb64(pb, moof_offset);
     if (flags & MOV_TFHD_DEFAULT_DURATION) {
-        track->default_duration = track->audio_vbr ? track->enc->frame_size : 1;
+        track->default_duration = get_cluster_duration(track, 0);
         avio_wb32(pb, track->default_duration);
     }
     if (flags & MOV_TFHD_DEFAULT_SIZE) {