From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id DA43B40B71 for ; Mon, 7 Mar 2022 22:16:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E30DE68B148; Tue, 8 Mar 2022 00:16:18 +0200 (EET) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB28C68A7A1 for ; Tue, 8 Mar 2022 00:16:11 +0200 (EET) Received: by mail-pf1-f178.google.com with SMTP id g1so15659500pfv.1 for ; Mon, 07 Mar 2022 14:16:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EkUEjmi6TQu1/uHyl90//cqLpXaCxAXM/4hR58KLTQw=; b=biSGcqXuke4EeJU9teMA4NW3ct/xLOJcpBWFU7sYyIlMha5i8Jmi7emRPjy2Vf7xxR CmWAaysG3Md0xVXOnab3faOa8Orb2AE6Ct2ZtDmAHlgSiG1qgrC1Gcj4GH2wVodVEqRm 3WTxuFqAYF0qQph1KTCIX05kAyWMko44zLL+ATzk4JB2mBd1sBMDU36088mnwsIGC7MW 7ah8RQFkmhYZTGjX7ABsHe6bnYs/zgwZFiEAZtzy4Yi6zbJ6jGyW1lOYKeGuTABrZdy8 eG2IPdRkSujPCXpWQ4sLxCkqOczBYxM/d6plvd77iMkUrUuWommm1BYQ7/XdeH68uKrq /FRA== X-Gm-Message-State: AOAM530+bMPwYdZQCwOMvW8O/8ViL4bBYQCymP/4YY4rh2/KO4K6z3FV Z9cv9Y4mhZtvICePM92F1dVx4d8QmO4= X-Google-Smtp-Source: ABdhPJwTS+pirNk4jZU7aWFGwVji/dpKmMLARdJYJCJ2NqWr/84HRWwo/WkTUGGpOEqsPYRnG2nvZg== X-Received: by 2002:a63:5a4a:0:b0:380:260d:47b0 with SMTP id k10-20020a635a4a000000b00380260d47b0mr7767356pgm.45.1646691369597; Mon, 07 Mar 2022 14:16:09 -0800 (PST) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id w23-20020a627b17000000b004f6cf170070sm10462543pfc.186.2022.03.07.14.16.07 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Mar 2022 14:16:09 -0800 (PST) Received: by localhost (sSMTP sendmail emulation); Mon, 07 Mar 2022 14:15:44 -0800 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 7 Mar 2022 14:15:36 -0800 Message-Id: <20220307221542.3265-1-pal@sandflow.com> X-Mailer: git-send-email 2.35.1.windows.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 1/7] avformat/imf: relocate static function imf_time_to_ts() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Pierre-Anthony Lemieux Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Pierre-Anthony Lemieux --- libavformat/imfdec.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 3ce850b75a..b98af020d2 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -154,6 +154,25 @@ static int imf_uri_is_dos_abs_path(const char *string) return 0; } +static int imf_time_to_ts(int64_t *ts, AVRational t, AVRational time_base) +{ + int dst_num; + int dst_den; + AVRational r; + + r = av_div_q(t, time_base); + + if ((av_reduce(&dst_num, &dst_den, r.num, r.den, INT64_MAX) != 1)) + return 1; + + if (dst_den != 1) + return 1; + + *ts = dst_num; + + return 0; +} + /** * Parse a ASSETMAP XML file to extract the UUID-URI mapping of assets. * @param s the current format context, if any (can be NULL). @@ -772,25 +791,6 @@ static int get_resource_context_for_timestamp(AVFormatContext *s, IMFVirtualTrac return AVERROR_STREAM_NOT_FOUND; } -static int imf_time_to_ts(int64_t *ts, AVRational t, AVRational time_base) -{ - int dst_num; - int dst_den; - AVRational r; - - r = av_div_q(t, time_base); - - if ((av_reduce(&dst_num, &dst_den, r.num, r.den, INT64_MAX) != 1)) - return 1; - - if (dst_den != 1) - return 1; - - *ts = dst_num; - - return 0; -} - static int imf_read_packet(AVFormatContext *s, AVPacket *pkt) { IMFVirtualTrackResourcePlaybackCtx *resource = NULL; -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".