[FFmpeg-cvslog] movenc: Calculate fps for tmcd without intermediate step.

Michael Niedermayer git at videolan.org
Thu Jan 24 19:12:22 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 17 18:51:49 2013 +0100| [9362f31b55510142eefa6d0cc26013a30bd4fc51] | committer: Michael Niedermayer

movenc: Calculate fps for tmcd without intermediate step.

Fixes part of Ticket2045

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9362f31b55510142eefa6d0cc26013a30bd4fc51
---

 libavformat/movenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index f08aa7e..d9b002e 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1147,7 +1147,7 @@ static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track)
 {
     int64_t pos = avio_tell(pb);
     int frame_duration = av_rescale(track->timescale, track->enc->time_base.num, track->enc->time_base.den);
-    int nb_frames = (track->timescale + frame_duration/2) / frame_duration;
+    int nb_frames = 1.0/av_q2d(track->enc->time_base) + 0.5;
 
     avio_wb32(pb, 0); /* size */
     ffio_wfourcc(pb, "tmcd");               /* Data format */



More information about the ffmpeg-cvslog mailing list