]> git.sesse.net Git - ffmpeg/commitdiff
avutil/timecode: fix starting frame number for 59.94 fps
authorGyan Doshi <gyandoshi@gmail.com>
Thu, 22 Feb 2018 12:34:42 +0000 (18:04 +0530)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 23 Feb 2018 00:53:34 +0000 (01:53 +0100)
The existing code for adjusting starting frame number assumes 29.97 as
stream fps.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavutil/timecode.c

index e9d8504ee7a68577143775d6c3ee8842c916cb44..60077ba0c04407459cf91e19911844b2eded6509 100644 (file)
@@ -214,7 +214,7 @@ int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *st
     tc->start = (hh*3600 + mm*60 + ss) * tc->fps + ff;
     if (tc->flags & AV_TIMECODE_FLAG_DROPFRAME) { /* adjust frame number */
         int tmins = 60*hh + mm;
-        tc->start -= 2 * (tmins - tmins/10);
+        tc->start -= (tc->fps == 30 ? 2 : 4) * (tmins - tmins/10);
     }
     return 0;
 }