On Wed, Jan 29, 2020 at 03:25:32PM -0800, Dale Curtis wrote:
> On Wed, Jan 29, 2020 at 4:55 AM Michael Niedermayer <mich...@niedermayer.cc>
> wrote:
> 
> > simpler solution, and also behaves arithmetically more correct when the
> > overflow happens in the othert direction:
> >
> > av_assert0(time_tolerance >= 0);
> >
> > if (e2_pts < e1_pts || e2_pts - (uint64_t)e1_pts < time_tolerance)
> >
> 
> Does that work? e1_pts is INT64_MIN in this case. So the (uint64_t)e1_pts >
> e2_pts.

the original code was this:
if (e2_pts - e1_pts < time_tolerance)

time_tolerance is always positive
e2_pts - e1_pts can be either positive or negative
if its negative (e2_pts < e1_pts) then the original would be true and thats
the first term of the new condition
otherwise e2_pts - e1_pts is positive and can be represented as a uint64_t
which is the 2nd term of the new condition

so i think it works but maybe ive missed something, for which values
of e2_pts do you see a problem with e1_pts = INT64_MIN?

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to