summaryrefslogtreecommitdiffstats
path: root/osdep/timer.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-10-22 04:17:03 +0200
committerDudemanguy <random342@airmail.cc>2023-11-05 17:36:17 +0000
commit71e888c2a0f0c816fe87d9b197878fb189adceed (patch)
tree16ce0eb16c315e81fcade268fbf4dc6976b18996 /osdep/timer.c
parent751790c2b3171f614576a990f44bf28b7efe4580 (diff)
downloadmpv-71e888c2a0f0c816fe87d9b197878fb189adceed.tar.bz2
mpv-71e888c2a0f0c816fe87d9b197878fb189adceed.tar.xz
timer: remove unused code
Diffstat (limited to 'osdep/timer.c')
-rw-r--r--osdep/timer.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/osdep/timer.c b/osdep/timer.c
index 17921c1665..d0a8a92f8a 100644
--- a/osdep/timer.c
+++ b/osdep/timer.c
@@ -16,7 +16,6 @@
*/
#include <stdlib.h>
-#include <pthread.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
@@ -66,32 +65,3 @@ int64_t mp_time_ns_add(int64_t time_ns, double timeout_sec)
return 1;
return time_ns + ti;
}
-
-#if !HAVE_WIN32_THREADS
-
-struct timespec mp_time_ns_to_realtime(int64_t time_ns)
-{
- struct timespec ts = {0};
- if (clock_gettime(CLOCK_REALTIME, &ts) != 0)
- return ts;
- int64_t time_rel = time_ns - mp_time_ns();
-
- // clamp to 1000 days in the future
- time_rel = MPMIN(time_rel, 1000 * 24 * 60 * 60 * INT64_C(1000000000));
- ts.tv_sec += time_rel / INT64_C(1000000000);
- ts.tv_nsec += time_rel % INT64_C(1000000000);
-
- if (ts.tv_nsec >= INT64_C(1000000000)) {
- ts.tv_sec++;
- ts.tv_nsec -= INT64_C(1000000000);
- }
-
- return ts;
-}
-
-struct timespec mp_rel_time_to_timespec(double timeout_sec)
-{
- return mp_time_ns_to_realtime(mp_time_ns_add(mp_time_ns(), timeout_sec));
-}
-
-#endif