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 BE3A346358 for ; Mon, 15 May 2023 11:47:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 499C868BE0C; Mon, 15 May 2023 14:47:50 +0300 (EEST) Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8006E6802C0 for ; Mon, 15 May 2023 14:47:44 +0300 (EEST) Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-199dd37f0e4so204347fac.2 for ; Mon, 15 May 2023 04:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684151262; x=1686743262; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=lHwk1E3KH8Ofo+Pn2k9bDPzl5JEVMeEBKU95iAjv/ek=; b=RQ/pAFu55+qkHunPTD2fMqY+/wEZLOzWRy+lqZRp8mZfMBUKll/z3tdKMOyWCrCANK Q0wvHTbDBmKCJZCLVINDPXKSV2LM5gUI5jFWUwUoYZbH6UvFRww4TZxRDZFC3tBx7Sy4 Q7nBzsjQnN03A4jTWNUKcXBN69mjojX5yDXjQCkp8+et+2Ga4AvrqJh5C8u4uPccm690 3x0Hndix+zkY3ogU5yp6FQoDI+D2I5Aq12AIplcUWccPkgWBi+ypopnbbWc+tzN5Azd7 JhN4yjYDSGH1IhQYDxA8PsgPVu6TtyqtEnqcU7pIWk8J0fdw1PpeJjTSq4LZBVFWev6O x+zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684151262; x=1686743262; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lHwk1E3KH8Ofo+Pn2k9bDPzl5JEVMeEBKU95iAjv/ek=; b=ETefLtJscVFn+eL3yL2IcpRdGpZNPDdUc1sxbGrbKWR4GMqytNReXcG2RGSF5F6ogg l2pVUtEnstnuuOAeCU+COGTg7L8uZnAEQaGIpYWstFKZcmD/AtpxYjMcAF8SQ4Mx2GJ7 wpyb8626qR76F1n3Ke2Q+MJh6qCoN158FHM69o8/sRqILQfWfs2aPnncCbE+psGII1Ry pvKlZfqlbbYAMCMR2oKqXL5EwN8z+n6vx/eX8uTuKOQiQgshuGXENiBxT/jjIRpsW/s4 K01nyCyrQ00yYR0n9Ceb4k88831LydjhAffScWnziyhH+gf7tcHFl0vWrbC6IXuCEMNQ 1L3g== X-Gm-Message-State: AC+VfDz3wKU8PSXy/rNy5k+yTRJsSE4d1Rfd/IBwwjkL4JMRqgZFiIov 1vzl2x3YKere5PjwxImL/K8eekkkbdU= X-Google-Smtp-Source: ACHHUZ66YXTgqZnVPaWUi+ze5bljyIipuVT3kMIAQavyjitjk2RYUnG1ZxYwHIUqGTzzVSfzQWJelA== X-Received: by 2002:a05:6870:d4c3:b0:187:796c:b5cd with SMTP id l3-20020a056870d4c300b00187796cb5cdmr15351534oai.23.1684151262573; Mon, 15 May 2023 04:47:42 -0700 (PDT) Received: from [192.168.0.12] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id e7-20020a9d5607000000b006adc6abf66dsm1161321oti.6.2023.05.15.04.47.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 May 2023 04:47:42 -0700 (PDT) Message-ID: <49d5394d-cb12-4c4f-447f-7d063c0a85cb@gmail.com> Date: Mon, 15 May 2023 08:47:48 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230507133255.20881-6-anton@khirnov.net> <20230515082254.4461-1-anton@khirnov.net> From: James Almer In-Reply-To: <20230515082254.4461-1-anton@khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH] 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 5/15/2023 5:22 AM, Anton Khirnov wrote: > Same issues as in the previous commit. > --- > Updated for changes in previous patch. > --- > libavcodec/Makefile | 2 +- > libavcodec/libdav1d.c | 10 ++++------ > 2 files changed, 5 insertions(+), 7 deletions(-) > > diff --git a/libavcodec/Makefile b/libavcodec/Makefile > index 9587e56493..4d59411662 100644 > --- a/libavcodec/Makefile > +++ b/libavcodec/Makefile > @@ -1086,7 +1086,7 @@ OBJS-$(CONFIG_LIBARIBCAPTION_DECODER) += libaribcaption.o ass.o > OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o > OBJS-$(CONFIG_LIBCODEC2_DECODER) += libcodec2.o > OBJS-$(CONFIG_LIBCODEC2_ENCODER) += libcodec2.o > -OBJS-$(CONFIG_LIBDAV1D_DECODER) += libdav1d.o > +OBJS-$(CONFIG_LIBDAV1D_DECODER) += libdav1d.o av1_parse.o > OBJS-$(CONFIG_LIBDAVS2_DECODER) += libdavs2.o > OBJS-$(CONFIG_LIBFDK_AAC_DECODER) += libfdk-aacdec.o > OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o > diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c > index af072da681..0320ae7c6c 100644 > --- a/libavcodec/libdav1d.c > +++ b/libavcodec/libdav1d.c > @@ -30,6 +30,7 @@ > #include "libavutil/opt.h" > > #include "atsc_a53.h" > +#include "av1_parse.h" > #include "avcodec.h" > #include "bytestream.h" > #include "codec_internal.h" > @@ -154,12 +155,9 @@ 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) { > - 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; > - } > + c->framerate = ff_av1_framerate(seq->num_ticks_per_picture, > + seq->num_units_in_tick, > + seq->time_scale); libdav1d unfortunately is currently exporting num_units_in_tick and time_scale as int, so in the (very unlikely but valid) case a value was > INT_MAX in the bitstream, it will be stored in those as a negative value. I suppose casting them to unsigned here should be enough. > > if (seq->film_grain_present) > c->properties |= FF_CODEC_PROPERTY_FILM_GRAIN; _______________________________________________ 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".