From patchwork Thu Jul 23 23:19:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 21242 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 6746644A7B8 for ; Fri, 24 Jul 2020 02:20:19 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C54D68B6E6; Fri, 24 Jul 2020 02:20:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E8CE768B66F for ; Fri, 24 Jul 2020 02:20:12 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id C1356E43B2; Fri, 24 Jul 2020 01:20:12 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id os1zb0YZlZrO; Fri, 24 Jul 2020 01:20:11 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 3197EE25F6; Fri, 24 Jul 2020 01:20:11 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Fri, 24 Jul 2020 01:19:46 +0200 Message-Id: <20200723231946.15959-2-cus@passwd.hu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200723231946.15959-1-cus@passwd.hu> References: <20200723231946.15959-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 2/2] avutil/timecode: cosmetics on av_timecode_get_smpte X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- 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; }