[FFmpeg-devel] [PATCH 3/3] avutil/timecode: cosmetics on av_timecode_get_smpte_from_framenum

Marton Balint cus at passwd.hu
Tue Jul 21 00:04:39 EEST 2020


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavutil/timecode.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavutil/timecode.c b/libavutil/timecode.c
index cb916970ef..b528e4a510 100644
--- a/libavutil/timecode.c
+++ b/libavutil/timecode.c
@@ -71,7 +71,7 @@ uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum)
 uint32_t av_timecode_get_smpte(AVRational rate, int drop, int hh, int mm, int ss, int ff)
 {
     uint32_t tc = 0;
-    uint32_t frames;
+    int frames = ff;
 
     /* For SMPTE 12-M timecodes, frame count is a special case if > 30 FPS.
        See SMPTE ST 12-1:2014 Sec 12.1 for more info. */
@@ -83,8 +83,6 @@ uint32_t av_timecode_get_smpte(AVRational rate, int drop, int hh, int mm, int ss
             else
                 tc |= (1 << 23);
         }
-    } else {
-        frames = ff;
     }
 
     tc |= drop << 30;
@@ -95,7 +93,7 @@ uint32_t av_timecode_get_smpte(AVRational rate, int drop, int hh, int mm, int ss
     tc |= (mm / 10) << 12;
     tc |= (mm % 10) << 8;
     tc |= (hh / 10) << 4;
-    tc |= (hh  % 10);
+    tc |= (hh % 10);
 
     return tc;
 }
-- 
2.26.2



More information about the ffmpeg-devel mailing list