summaryrefslogtreecommitdiffstats
path: root/osdep/timer-linux.c
Commit message (Collapse)AuthorAgeFilesLines
* build: remove nanosleep() checkwm42017-12-021-9/+0
| | | | Also guaranteed by POSIX.
* osdep/timer*: change license to LGPLwm42017-05-051-7/+7
| | | | | | | | | | | | | | All authors have agreed, with the following exceptions: e68d7f6858: wight wasn't asked (I think...), but even if he modified the patch he applied, all code added by it was removed again later. cb7768f9bb: nick could not be reached, but the declarations he added as well as the full timer.c file were deleted again in cff81fe498 and f800a42e45 (did it really take 6 years to remove unused declarations?). ffaf4af230: it looks like this person wasn't contacted, but the code added was removed again in f544bcf105.
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* timer: reduce ifdef headsplitting-factorwm42014-03-091-3/+8
| | | | | I'd rather duplicate some trivial code, rather than split functions in the middle with ifdefs.
* timer: switch to CLOCK_MONOTONICwm42014-03-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | Apparently, this is always _really_ monotonic, despite what the Linux manpages say. So this should be much better than gettimeofday(). (At times there were kernel bugs which broke the monotonic property.) From the perspective of the player, time can still be discontinuous (you could just stop the process with ^Z), but at least it's guaranteed to be monotonic without further hacks required. Also note that clock_gettime() returns the time in nanoseconds. We want microseconds only, because that's the unit we chose internally. Another problem is that nanoseconds can wrap pretty quickly (less than 300 years in 63 bits), so it's just better to use microseconds. The devision won't make the code that much slower (compilers can avoid a real division). Note: this expects that the system provides clock_gettime() as well as CLOCK_MONOTONIC. Both are optional according to POSIX. The only system I know which doesn't have these, OSX, has seperate timer code anyway, but I still don't know whether more obscure (yet supported) platforms have a problem with this, so I'm playing safely. But this still expects that CLOCK_MONOTONIC always works at runtime if it's defined.
* configure: uniform the defines to #define HAVE_xxx (0|1)Stefano Pigozzi2013-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
* timer: refactor, add 64 bit timer functionwm42013-05-261-20/+12
| | | | | | | | | | | | | | 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-7/+0
| | | | This was unreferenced and useless.
* Remove leftover BeOS support stuffwm42012-08-031-3/+0
| | | | As by mplayer-svn commit 33972. Their BeOS removal was more thorough.
* Remove trailing whitespace from most filesUoti Urpala2009-07-071-2/+2
|
* Merge svn changes up to r29277Uoti Urpala2009-05-081-5/+8
|\
| * cosmetics: reindentdiego2009-04-191-31/+38
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29198 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28862Uoti Urpala2009-03-071-1/+20
|\|
| * Add standard license headers to files.diego2009-03-011-1/+20
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28779 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Include corresponding .h in some .c filesUoti Urpala2008-08-121-0/+1
| |
* | Merge svn changes up to r26979Uoti Urpala2008-06-041-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the conflicts are trivial. Conflicts: Makefile cfg-mplayer.h input/input.c libmenu/vf_menu.c libmpcodecs/dec_video.c libmpcodecs/vf_expand.c libmpcodecs/vf_vo.c libmpdemux/demux_mkv.c libmpdemux/demuxer.c libmpdemux/demuxer.h libvo/vo_directfb2.c libvo/vo_gl.c libvo/vo_winvidix.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_xvmc.c libvo/x11_common.c mplayer.c osdep/timer-linux.c stream/cache2.c
| * cosmetics: Remove useless parentheses from return statements.diego2008-05-161-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26791 b3059339-0415-0410-9bf9-f77b7e298cf2
* | osdep: Remove cruftUoti Urpala2008-04-281-15/+0
| | | | | | | | Delete some commented out or otherwise unused lines.
* | timers: Remove GetRelativeTime()Uoti Urpala2008-04-281-13/+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.
* Fix warnings when compiling test application.diego2007-12-281-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25538 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename timer-lx.c --> timer-linux.c.diego2007-11-211-0/+74
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25129 b3059339-0415-0410-9bf9-f77b7e298cf2