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 8A6EE40B5E for ; Mon, 7 Mar 2022 22:17:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 10C7468B1B2; Tue, 8 Mar 2022 00:16:30 +0200 (EET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A297F68B1B0 for ; Tue, 8 Mar 2022 00:16:23 +0200 (EET) Received: by mail-pf1-f169.google.com with SMTP id d187so15626937pfa.10 for ; Mon, 07 Mar 2022 14:16:23 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=rPGMObBRuj26RPvSu+2dG8DtZLw1ENbsXIR+DY1VKWM=; b=FYBUqW8ZvY4DIwn/OY3XOQgZ6f+Ic6oHWgEkt31Cw9+0jrM1X5QWXdYpPAFWlZElGm try8ObSqo4JwtFEULSXCeNPGibSne0T2FCgUAG+cbpC/nTgeM5gJH+UVe++8vPD5IOoQ a5O8jr51suzQUd1nKRSYklORXKqDi9eeiubUWoPgFGIBH56xwnS92DBdoKquqLRNj76V hOA8jdU41qcSb3uFIBJWv3cL5w5XnsN1SWetC5oZhc2v/TBn7mPqIrmiJD7cs40kfkcM TgQoSrGEh9RfI7cG/RObcKOx1GuCMFXFwtbY2YZcMZEASjTbjez6MshWozK63DNK8V75 HkcQ== X-Gm-Message-State: AOAM532XNBOa/h+tlaXSe3/Xu51b6D8o0Mn3LP8Oz8EGVy9+g7w4uHTM lxVA/25z1fLHbEN7JPuNW4QgNApujAg= X-Google-Smtp-Source: ABdhPJzD8bhhvA5tgj/tiqkvAKTgsx2A9P/Ewy3ibY8JBLtIZK19Bk1/IEtKBnUNf2oKpkTxbxEz/g== X-Received: by 2002:a63:7d49:0:b0:378:907d:1fc7 with SMTP id m9-20020a637d49000000b00378907d1fc7mr11543737pgn.252.1646691381573; Mon, 07 Mar 2022 14:16:21 -0800 (PST) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id x23-20020a63fe57000000b0036490068f12sm12687814pgj.90.2022.03.07.14.16.20 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Mar 2022 14:16:21 -0800 (PST) Received: by localhost (sSMTP sendmail emulation); Mon, 07 Mar 2022 14:15:57 -0800 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 7 Mar 2022 14:15:41 -0800 Message-Id: <20220307221542.3265-6-pal@sandflow.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20220307221542.3265-1-pal@sandflow.com> References: <20220307221542.3265-1-pal@sandflow.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 6/7] avformat/imf: refactor to use ff_rescale_interval() 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 | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index ac212b05e1..a19e431df3 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -904,14 +904,6 @@ static int imf_probe(const AVProbeData *p) return AVPROBE_SCORE_MAX; } -static void rescale_interval(AVRational tb_in, AVRational tb_out, - int64_t *min_ts, int64_t *ts, int64_t *max_ts) -{ - *ts = av_rescale_q(*ts, tb_in, tb_out); - *min_ts = av_rescale_q_rnd(*min_ts, tb_in, tb_out, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); - *max_ts = av_rescale_q_rnd(*max_ts, tb_in, tb_out, AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX); -} - static int coherent_ts(int64_t ts, AVRational in_tb, AVRational out_tb) { int dst_num; @@ -937,13 +929,13 @@ static int imf_seek(AVFormatContext *s, int stream_index, int64_t min_ts, /* rescale timestamps to Composition edit units */ if (stream_index < 0) - rescale_interval(AV_TIME_BASE_Q, - av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), - &min_ts, &ts, &max_ts); + ff_rescale_interval(AV_TIME_BASE_Q, + av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), + &min_ts, &ts, &max_ts); else - rescale_interval(s->streams[stream_index]->time_base, - av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), - &min_ts, &ts, &max_ts); + ff_rescale_interval(s->streams[stream_index]->time_base, + av_make_q(c->cpl->edit_rate.den, c->cpl->edit_rate.num), + &min_ts, &ts, &max_ts); /* requested timestamp bounds are too close */ if (max_ts < min_ts) -- 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".