summaryrefslogtreecommitdiffstats
path: root/osdep/timer.h
Commit message (Collapse)AuthorAgeFilesLines
* Replace calls to usec_sleep()wm42013-05-261-3/+0
| | | | | | This is just dumb sed replacement to mp_sleep_us(). Also remove the now unused usec_sleep() wrapper.
* Replace all calls to GetTimer()/GetTimerMS()wm42013-05-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | GetTimer() is generally replaced with mp_time_us(). Both calls return microseconds, but the latter uses int64_t, us defined to never wrap, and never returns 0 or negative values. GetTimerMS() has no direct replacement. Instead the other functions are used. For some code, switch to mp_time_sec(), which returns the time as double float value in seconds. The returned time is offset to program start time, so there is enough precision left to deliver microsecond resolution for at least 100 years. Unless it's casted to a float (or the CPU reduces precision), which is why we still use mp_time_us() out of paranoia in places where precision is clearly needed. Always switch to the correct time. The whole point of the new timer calls is that they don't wrap, and storing microseconds in unsigned int variables would negate this. In some cases, remove wrap-around handling for time values.
* timer: refactor, add 64 bit timer functionwm42013-05-261-3/+21
| | | | | | | | | | | | | | Make OS specific timer code export a mp_raw_time_us() function, and add generic implementations of GetTimer()/GetTimerMS() using this function. New mpv code is supposed to call mp_time_us() in situations where precision is absolutely needed, or mp_time_s() otherwise. Make it so that mp_time_us() will return a value near program start. We don't set it to 0 though to avoid confusion with relative vs. absolute time. Instead, pick an arbitrary offset. Move the test program in timer-darwin.c to timer.c, and modify it to work with the generic timer functions.
* timer: remove timer_namewm42012-09-071-2/+0
| | | | This was unreferenced and useless.
* Merge svn changes up to r28862Uoti Urpala2009-03-071-0/+18
|\
| * Add standard license headers to files.diego2009-03-011-0/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28779 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Get rid of pointless 'extern' keywords.diego2008-12-031-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28085 b3059339-0415-0410-9bf9-f77b7e298cf2
* | osdep: Remove cruftUoti Urpala2008-04-281-6/+0
| | | | | | | | Delete some commented out or otherwise unused lines.
* | timers: Remove GetRelativeTime()Uoti Urpala2008-04-281-1/+0
| | | | | | | | | | | | | | | | | | | | Move the code calculating time delta since last query out of the platform-specific drivers and into mplayer.c. The platform-specific drivers now return absolute values only. The way the code in timer-darwin.c uses doubles in wrapping arithmetic looks questionable and this change might make problems in it more visible.
* | osdep: Change timer_name to a saner typeUoti Urpala2008-04-281-1/+1
|/ | | | | timer_name was a (non-const) pointer to a const char array. Make the symbol the array itself.
* Identifiers starting with underscores are reserved.diego2007-07-311-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23954 b3059339-0415-0410-9bf9-f77b7e298cf2
* Patch by Stefan Huehner / stefan % huehner ! org \rathann2006-02-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | patch replaces '()' for the correct '(void)' in function declarations/prototypes which have no parameters. The '()' syntax tell thats there is a variable list of arguments, so that the compiler cannot check this. The extra CFLAG '-Wstrict-declarations' shows those cases. Comments about a similar patch applied to ffmpeg: That in C++ these mean the same, but in ANSI C the semantics are different; function() is an (obsolete) K&R C style forward declaration, it basically means that the function can have any number and any types of parameters, effectively completely preventing the compiler from doing any sort of type checking. -- Erik Slagter Defining functions with unspecified arguments is allowed but bad. With arguments unspecified the compiler can't report an error/warning if the function is called with incorrect arguments. -- Måns Rullgård git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17567 b3059339-0415-0410-9bf9-f77b7e298cf2
* Native darwin timer update.wight2004-08-041-0/+2
| | | | | | | Patch by Dan Christiansen <danchr@daimi.au.dk> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12955 b3059339-0415-0410-9bf9-f77b7e298cf2
* linux->osdeparpi2003-02-091-0/+17
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9381 b3059339-0415-0410-9bf9-f77b7e298cf2