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 2F52F445E1 for ; Mon, 19 Sep 2022 14:47:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B47AA68BC9C; Mon, 19 Sep 2022 17:47:34 +0300 (EEST) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 490BB68BC54 for ; Mon, 19 Sep 2022 17:47:28 +0300 (EEST) Received: by mail-pj1-f53.google.com with SMTP id p1-20020a17090a2d8100b0020040a3f75eso6340455pjd.4 for ; Mon, 19 Sep 2022 07:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandflow-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date; bh=kfs0HSCVETCqQf8pKCt7Cuz1bQfaYyEpfBp+2Ir67DY=; b=gaIIdXpaufPdVkzKcZE2uIuVvDuB89arMmRX9zVwR4IsDQ8Zr6FCwLhzo3RfHaB6fT lnWEJYcaQwCH1kaV2eFJs/IMEdfm1YMn31GbVmeam0ObmC0mp6l7/c+MxDgp6jSBMv3b 03D9KoVjhbBUl7NymFMo3JO1GKGLra/bujMhZDLpcg5J5UWvsYzAIgtqxKw/BaQAHfC/ ziD30m/2h2S/Ng0Hv08aFsxrlrGNYOQwSE0OIH0oJQx/YhGuNtzMXxZiVhHF1LJWevCh oh0xoJhCvNpADKOeoZBvbT43Q6qOUq2yFZPU/IxnrVEOu8NvDxdAOp71i1fprTdNr/D0 j48w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=kfs0HSCVETCqQf8pKCt7Cuz1bQfaYyEpfBp+2Ir67DY=; b=8IcHO1NvPHnRoIOB/Su7v59E7rNC1nbitjLXlYjAv3a6c0snRvzNPQA88QEdcxpOL/ KiKJTor3nxwkiAnS5qSPV9fcbUhPvHUqqBmVBaB2ETFmCghNDth8etpvLRBdkG71/71d bYrAYve/3DRgghfaZNfHSnMfCD859DtQ11vimKcjhwD+A/BC+T2XRQhctqch2P7qxJMU 2xIkNb/QssSHSFdYxBTIDL+6vOhvqeBmadSv74xvl518/V0z14IeX1W/h9nn669bxbGh oc8c2QyFsBkZ9XfKpaoAz/Vw8EwdNWGFHxse1UAQiHSpNAhwAsL6RXpLPGyB6ypP1obH nMKw== X-Gm-Message-State: ACrzQf0uMb+kZIjpoJW/cZGDuBG8+uCuEN5bCjLNIxlAZA8ODha8ypCU uhDHnu98jPa9uh3JojWqs+tvJxYvIgUN+g== X-Google-Smtp-Source: AMsMyM4n+p2maH6VO6+mIcHzNloxN+0VvNqGAdjLjcKIVtrDf9qBJ0eeVYGZZgQwUx/zWOIgaVicCA== X-Received: by 2002:a17:902:e548:b0:178:87d2:f29f with SMTP id n8-20020a170902e54800b0017887d2f29fmr114183plf.142.1663598845624; Mon, 19 Sep 2022 07:47:25 -0700 (PDT) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com. [209.85.215.170]) by smtp.gmail.com with ESMTPSA id t15-20020a17090ad50f00b002008ba3a74csm6801405pju.52.2022.09.19.07.47.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 07:47:24 -0700 (PDT) Received: by mail-pg1-f170.google.com with SMTP id s206so26996810pgs.3 for ; Mon, 19 Sep 2022 07:47:24 -0700 (PDT) X-Received: by 2002:a62:6406:0:b0:54e:fa79:ba40 with SMTP id y6-20020a626406000000b0054efa79ba40mr5217617pfb.60.1663598843777; Mon, 19 Sep 2022 07:47:23 -0700 (PDT) MIME-Version: 1.0 References: <20220907200233.21255-1-pal@sandflow.com> <20220916172655.GV2088045@pb2> <20220916201451.GF2088045@pb2> <20220917144322.GG2088045@pb2> <20220919144240.GJ2088045@pb2> In-Reply-To: <20220919144240.GJ2088045@pb2> From: Pierre-Anthony Lemieux Date: Mon, 19 Sep 2022 07:47:11 -0700 X-Gmail-Original-Message-ID: Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] format/imfdec: improve error handling when selecting tracks for playback 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-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: On Mon, Sep 19, 2022 at 7:42 AM Michael Niedermayer wrote: > > On Sat, Sep 17, 2022 at 08:57:37AM -0700, Pierre-Anthony Lemieux wrote: > > On Sat, Sep 17, 2022 at 7:43 AM Michael Niedermayer > > wrote: > > > > > > On Fri, Sep 16, 2022 at 01:19:09PM -0700, Pierre-Anthony Lemieux wrote: > > > > On Fri, Sep 16, 2022 at 1:15 PM Michael Niedermayer > > > > wrote: > > > > > > > > > > On Fri, Sep 16, 2022 at 10:39:22AM -0700, Pierre-Anthony Lemieux wrote: > > > > > > On Fri, Sep 16, 2022 at 10:27 AM Michael Niedermayer > > > > > > wrote: > > > > > > > > > > > > > > On Wed, Sep 07, 2022 at 01:02:33PM -0700, pal@sandflow.com wrote: > > > > > > > > From: Pierre-Anthony Lemieux > > > > > > > > > > > > > > > > Addresses coverity 1512414 > > > > > > > > > > > > > > > > --- > > > > > > > > libavformat/imfdec.c | 15 ++++++++++++--- > > > > > > > > 1 file changed, 12 insertions(+), 3 deletions(-) > > > > > > > > > > > > > > > > diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c > > > > > > > > index 5bbe7a53f8..58b1455c9f 100644 > > > > > > > > --- a/libavformat/imfdec.c > > > > > > > > +++ b/libavformat/imfdec.c > > > > > > > > @@ -681,8 +681,11 @@ static IMFVirtualTrackPlaybackCtx *get_next_track_with_minimum_timestamp(AVForma > > > > > > > > { > > > > > > > > IMFContext *c = s->priv_data; > > > > > > > > IMFVirtualTrackPlaybackCtx *track; > > > > > > > > > > > > > > > + AVRational minimum_timestamp = av_make_q(INT_MAX, 1); > > > > > > > > - AVRational minimum_timestamp = av_make_q(INT32_MAX, 1); > > > > > > > > > > > > > > iam not sure thats a good idea, it would change behavior on different platforms > > > > > > > > > > > > I was following the earlier observations that "The initialization of > > > > > > minimum_timestamp presumes that int are 32bit which need not be true": > > > > > > > > > > > > http://ffmpeg.org/pipermail/ffmpeg-devel/2022-August/300587.html > > > > > > > > > > > > If I am not mistaken, the numerator and denominator of AVRational are > > > > > > defined as `int`: > > > > > > > > > > > > https://www.ffmpeg.org/doxygen/trunk/structAVRational.html > > > > > > > > > > > > What would be the alternative? > > > > > > > > > > I dont understand why this code uses AVRational for timestamps > > > > > normally timestamps are int64_t with a AVRational timebase and would use > > > > > av_compare_ts() for comparing > > > > > > > > Temporal offsets on IMF tracks are typically expressed as rationals, > > > > and each track can have its own timebase. > > > > > > av_compare_ts() can compare 2 timestamps in 2 different timebases > > > > > > the problem with using AVRational for timestamps in 1sec units is > > > that alot of 64bit * 32/32bit timestamps cannot be represented exactly > > > > Ok. It might be possible to refactor the imfdec timing model in terms > > of (int) time offset + timebase instead of (rational) time offset, or > > at least detect when the current scheme fails. This will require > > careful study. > > > > > Any objections to tackling this refactoring as a separate patchset, > > since this patchet is intended to address the coverity issue? > > you can do it in whichever way works best for you. > Iam just saying that AVRational with more than 32/32bit is problematic Ok. Will revert to initializing minimum_timestamp with INT32_MAX for now so that we can merge this fix. > > consider av_add_q() it expects the product of various fields to fit > int64_t > > if int is 64bit AND AVRational uses teh extra range the implementation > needs a 128bit type or some other modification > > thx > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Into a blind darkness they enter who follow after the Ignorance, > they as if into a greater darkness enter who devote themselves > to the Knowledge alone. -- Isha Upanishad > _______________________________________________ > 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". _______________________________________________ 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".