]> git.sesse.net Git - vlc/commitdiff
Timer: fallback to realtime if monotonic clock is not implemented
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 2 Jun 2009 19:10:41 +0000 (22:10 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 2 Jun 2009 19:10:41 +0000 (22:10 +0300)
src/misc/pthread.c

index f3127f3e0fab902aa68b7e29622fcd4ead651695..be39b1b53155478ad00b4e67d5a117371423d60b 100644 (file)
@@ -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;
 }