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 42A0B445DD for ; Mon, 19 Sep 2022 14:42:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 03CA468BC95; Mon, 19 Sep 2022 17:42:49 +0300 (EEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1D40368BAAA for ; Mon, 19 Sep 2022 17:42:43 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 345BC60013 for ; Mon, 19 Sep 2022 14:42:41 +0000 (UTC) Date: Mon, 19 Sep 2022 16:42:40 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220919144240.GJ2088045@pb2> References: <20220907200233.21255-1-pal@sandflow.com> <20220916172655.GV2088045@pb2> <20220916201451.GF2088045@pb2> <20220917144322.GG2088045@pb2> MIME-Version: 1.0 In-Reply-To: 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: multipart/mixed; boundary="===============6319490530108041067==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6319490530108041067== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+6PFc4gFogXO4FO2" Content-Disposition: inline --+6PFc4gFogXO4FO2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wr= ote: > > > > > 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 wrot= e: > > > > > > > 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_n= ext_track_with_minimum_timestamp(AVForma > > > > > > > { > > > > > > > IMFContext *c =3D s->priv_data; > > > > > > > IMFVirtualTrackPlaybackCtx *track; > > > > > > > > > > > > > + AVRational minimum_timestamp =3D av_make_q(INT_MAX, 1); > > > > > > > - AVRational minimum_timestamp =3D av_make_q(INT32_MAX, 1); > > > > > > > > > > > > iam not sure thats a good idea, it would change behavior on dif= ferent platforms > > > > > > > > > > I was following the earlier observations that "The initialization= of > > > > > minimum_timestamp presumes that int are 32bit which need not be t= rue": > > > > > > > > > > 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 woul= d 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 >=20 > 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. >=20 > 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 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=20 needs a 128bit type or some other modification thx [...] --=20 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 --+6PFc4gFogXO4FO2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYyh/4AAKCRBhHseHBAsP q/R8AKCGV2pr6zF8eneFNz+QmmMjG+2cmgCeOc/sunOtMjyUzArKGLy7NCYcD2c= =Ou9j -----END PGP SIGNATURE----- --+6PFc4gFogXO4FO2-- --===============6319490530108041067== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============6319490530108041067==--