[vlc-devel] commit: Timer: fallback to realtime if monotonic clock is not implemented ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Jun 2 21:11:01 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jun  2 22:10:41 2009 +0300| [69aebd4e3932ef283e154676da82eeac7d37926a] | committer: Rémi Denis-Courmont 

Timer: fallback to realtime if monotonic clock is not implemented

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=69aebd4e3932ef283e154676da82eeac7d37926a
---

 src/misc/pthread.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/misc/pthread.c b/src/misc/pthread.c
index f3127f3..be39b1b 100644
--- a/src/misc/pthread.c
+++ b/src/misc/pthread.c
@@ -614,8 +614,13 @@ int vlc_timer_create (vlc_timer_t *id, void (*func) (vlc_timer_t *, void *),
     id->func = func;
     id->data = data;
 
+#if (_POSIX_CLOCK_SELECTION >= 0)
     if (timer_create (CLOCK_MONOTONIC, &ev, &id->handle))
+#else
+    if (timer_create (CLOCK_REALTIME, &ev, &id->handle))
+#endif
         return errno;
+
     return 0;
 }
 




More information about the vlc-devel mailing list