[MPlayer-dev-eng] [PATCH] get_time

Dan Oscarsson Dan.Oscarsson at tieto.com
Mon Sep 13 08:59:30 CEST 2010


sön 2010-09-12 klockan 19:31 +0200 skrev Nicolas George:
> Le sextidi 26 fructidor, an CCXVIII, Dan Oscarsson a écrit :
> > A test like time1 < time2 can fail if one of the values have wrapped
> > around.
> 
> But it works if you write it "(unsigned)time2 - (unsigned)time1 < INT_MAX".
> Or maybe I missed what kind of warp you are talking about.
> 

Yes, I guess that would work, but that would make the code much more
difficult to understand. It took me some time before I realised that the
the calculations of time differences in mplayer work despite wrapping of
time. I prefer to have the code more easy to understand than to save
some storage or a few CPU cycles - or what is wrong with 64-bit time?

Regards,

   Dan



More information about the MPlayer-dev-eng mailing list