From patchwork Sun May 7 13:32:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41515 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp1707122pzb; Sun, 7 May 2023 06:33:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sa12gv9+glKnIWeBIXzSrEYIWxdbkMBd80S/KvuEJLNl2Iltv+PokSc9giDouhH1iO8by X-Received: by 2002:a17:907:6289:b0:961:8d21:a480 with SMTP id nd9-20020a170907628900b009618d21a480mr6051305ejc.58.1683466407244; Sun, 07 May 2023 06:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683466407; cv=none; d=google.com; s=arc-20160816; b=k11M6BtICghlrEN28lsOdpVKz3xhtrXuI5U5MjuYrnQGQ2MOyTebOUTa56ND2EfHB7 mCpEDTqeRl51eqeGfXkW+9YrMeb+fxuAQ7A7Bm+odyO4DorSMko2tqlr1wFsRmsbztY9 7i/fsn9Tmy8qjULUAc6IU4XuFqntE060N7Sd2qlHdVrs0Lobg/fTkKrrrMNgMGFkhruP mrpmCiXHs5Km2zItDBwy+Jp9HJfc5kyixfXvP6aABqpPZzyzPgpsE+ErHN3Vks8miuKR V7v6W6izXxD35mZJFyr73cIMtwJz8vAdfk3vnYkKHPWD5NCgOOmQJIJ0e5mbETWDJYTL i93w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=oLBLHm0+oplAEkKHfcJjxyPOtsf2wnrE4qrUvy8ow9I=; b=QdHcHfnSPNaOvQD2hRFQ6YoNFT22Wk0PFTwM447WdlVaQSAUOgIxA8dPL3L5DfS7oG HqSf3E+Mv/nZlL18CfZUrMbp5qG/x+hJVdB03+eVR+AwsLWdZmCzCG2P4EPO2ZOGIKJw lLufIao9iyU8VJudfZzjsNKAVmrGeDhTZwb9xFqVy5cD4SYTaXNLq7j9tpM1sjYI+IdF WDZu5nLmIRCh8deAYs1SbQaSj/+S2ceCQR07T6LL+ivI4ErVPCTKomYb7CdMv84UdzQd 5I1j1omEOr3WTcVCNbylBwMmbY8SXHFuzXQ3WTKOH0U97hMWGptuvt6bStH88Gjra/LU rECA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hc36-20020a17090716a400b0096646da8955si954749ejc.760.2023.05.07.06.33.26; Sun, 07 May 2023 06:33:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5C12B68C06B; Sun, 7 May 2023 16:33:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6687868BFF3 for ; Sun, 7 May 2023 16:33:15 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B85922406CC for ; Sun, 7 May 2023 15:33:14 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id fF6wnKBfgN-8 for ; Sun, 7 May 2023 15:33:12 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id AC54B2404EC for ; Sun, 7 May 2023 15:33:12 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 6C82B3A1267 for ; Sun, 7 May 2023 15:33:05 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 7 May 2023 15:32:48 +0200 Message-Id: <20230507133255.20881-6-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507133255.20881-1-anton@khirnov.net> References: <20230507133255.20881-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/13] lavc/libdav1d: fix exporting framerate 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3YE71S0xHyH6 Same issues as in the previous commit. --- libavcodec/libdav1d.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 87aed16749..19b6a880da 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -154,11 +154,11 @@ static void libdav1d_init_params(AVCodecContext *c, const Dav1dSequenceHeader *s else c->pix_fmt = pix_fmt[seq->layout][seq->hbd]; - if (seq->num_units_in_tick && seq->time_scale) { + if (seq->num_units_in_tick && seq->time_scale && + seq->num_ticks_per_picture < INT_MAX / seq->num_units_in_tick) { av_reduce(&c->framerate.den, &c->framerate.num, - seq->num_units_in_tick, seq->time_scale, INT_MAX); - if (seq->equal_picture_interval) - c->ticks_per_frame = seq->num_ticks_per_picture; + seq->num_units_in_tick * FFMAX(seq->num_ticks_per_picture, 1), + seq->time_scale, INT_MAX); } if (seq->film_grain_present)