diff mbox series

[FFmpeg-devel,v2,2/2] avutil/timecode: cosmetics on av_timecode_get_smpte

Message ID 20200723231946.15959-2-cus@passwd.hu
State New
Headers show
Series [FFmpeg-devel,v2,1/2] avutil/timecode: fix av_timecode_get_smpte_from_framenum with 50/60 fps
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Marton Balint July 23, 2020, 11:19 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavutil/timecode.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

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;
 }