From patchwork Mon Jul 20 21:04:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 21207 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 5C1DB44A8A7 for ; Tue, 21 Jul 2020 00:04:58 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 40D0F68BA99; Tue, 21 Jul 2020 00:04:58 +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 D2A3568B8B8 for ; Tue, 21 Jul 2020 00:04:51 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 9EACEE4332; Mon, 20 Jul 2020 23:04:51 +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 u__xoStP8wSP; Mon, 20 Jul 2020 23:04:50 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id A2AEFE3893; Mon, 20 Jul 2020 23:04:49 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 20 Jul 2020 23:04:39 +0200 Message-Id: <20200720210439.1809-3-cus@passwd.hu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200720210439.1809-1-cus@passwd.hu> References: <20200720210439.1809-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avutil/timecode: cosmetics on av_timecode_get_smpte_from_framenum 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; }