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 89A8B402E2 for ; Mon, 21 Feb 2022 06:02:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 43DB768A7C8; Mon, 21 Feb 2022 08:02:56 +0200 (EET) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DB1E568A596 for ; Mon, 21 Feb 2022 08:02:49 +0200 (EET) Received: by mail-pg1-f174.google.com with SMTP id d16so13395491pgd.9 for ; Sun, 20 Feb 2022 22:02:49 -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=aSD7qq/ifbpSHDhVVTGlYY+vorwGFNlj0snPmJqNzCV7nLHjRpIdYxp2bD2o8Io240 2GmUK5AGt5NE3uoepqlB5fdHN40GqLF6q49WjdCaIhXrOFCDoYeG1B/JVsZ9YnWWzD11 PqRpZ5x0WQFW7ZKN9t+8vNZ+50DKmPTYsLNJnfZE3aN5LPbdifhlPsvoPAf5DoT1nIWZ eMLtNlj99U1VAeo53cJ+F0BdMltcqvXW7cTM18cJGIdlh3nRcYjt3kpJGTu5/QJ7L2ds Tg4Ep8RWDwdtzpGkBMgVPGZbPxe679wCuvcVgAfLRTv8LB3bw33lWy862Y69QG9KJwgu K6GQ== X-Gm-Message-State: AOAM531YzPvepHCrZnBR0V3o/FM3cYgnhmBdnGLBnROgISEKNLJrnvHY dyHuXgIhxnxTI/I01v/bv2HF0gNaC7g= X-Google-Smtp-Source: ABdhPJzYhiESwLeTTNO41fkDg/bacAVteeFqF5OkL4++LlURntGbOo0DnG30pi1jfXLY8J1NWh1xbQ== X-Received: by 2002:a05:6a00:2387:b0:4e0:5414:da5c with SMTP id f7-20020a056a00238700b004e05414da5cmr18625248pfc.85.1645423367371; Sun, 20 Feb 2022 22:02:47 -0800 (PST) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id g63sm10780633pfb.65.2022.02.20.22.02.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Feb 2022 22:02:47 -0800 (PST) Received: by localhost (sSMTP sendmail emulation); Sun, 20 Feb 2022 22:02:34 -0800 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Sun, 20 Feb 2022 22:02:24 -0800 Message-Id: <20220221060230.6665-1-pal@sandflow.com> X-Mailer: git-send-email 2.35.1.windows.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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".