[FFmpeg-cvslog] lavf/movenc: use framerate correctly in mov_write_tmcd_tag

Anton Khirnov git at videolan.org
Thu Apr 8 12:01:38 EEST 2021


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Apr  4 20:07:15 2021 +0200| [f53f9fe51add5a140ae40e98a8873c1e2a3a5799] | committer: Anton Khirnov

lavf/movenc: use framerate correctly in mov_write_tmcd_tag

Current code uses its inverse.

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

 libavformat/movenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index c00e38e72f..0b620a802d 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2353,8 +2353,8 @@ static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track)
         return AVERROR(EINVAL);
 #endif
     } else {
-        frame_duration = av_rescale(track->timescale, track->st->avg_frame_rate.num, track->st->avg_frame_rate.den);
-        nb_frames      = ROUNDED_DIV(track->st->avg_frame_rate.den, track->st->avg_frame_rate.num);
+        frame_duration = av_rescale(track->timescale, track->st->avg_frame_rate.den, track->st->avg_frame_rate.num);
+        nb_frames      = ROUNDED_DIV(track->st->avg_frame_rate.num, track->st->avg_frame_rate.den);
     }
 
     if (nb_frames > 255) {
@@ -6234,7 +6234,7 @@ static int mov_create_timecode_track(AVFormatContext *s, int index, int src_inde
         return AVERROR(ENOMEM);
     track->par->codec_type = AVMEDIA_TYPE_DATA;
     track->par->codec_tag  = track->tag;
-    track->st->avg_frame_rate = av_inv_q(rate);
+    track->st->avg_frame_rate = rate;
 
     /* the tmcd track just contains one packet with the frame number */
     pkt->data = data;



More information about the ffmpeg-cvslog mailing list