diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-10-22 04:17:03 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-05 17:36:17 +0000 |
commit | 71e888c2a0f0c816fe87d9b197878fb189adceed (patch) | |
tree | 16ce0eb16c315e81fcade268fbf4dc6976b18996 /osdep | |
parent | 751790c2b3171f614576a990f44bf28b7efe4580 (diff) | |
download | mpv-71e888c2a0f0c816fe87d9b197878fb189adceed.tar.bz2 mpv-71e888c2a0f0c816fe87d9b197878fb189adceed.tar.xz |
timer: remove unused code
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/timer.c | 30 | ||||
-rw-r--r-- | osdep/timer.h | 7 |
2 files changed, 0 insertions, 37 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 diff --git a/osdep/timer.h b/osdep/timer.h index ba7e22d6c5..3a925caec3 100644 --- a/osdep/timer.h +++ b/osdep/timer.h @@ -60,11 +60,4 @@ void mp_end_hires_timers(int resolution_ms); // Takes care of possible overflows. Never returns a negative or 0 time. int64_t mp_time_ns_add(int64_t time_ns, double timeout_sec); -// Convert the mp time in nanoseconds to a timespec using CLOCK_REALTIME. -struct timespec mp_time_ns_to_realtime(int64_t time_ns); - -// Convert the relative timeout in seconds to a timespec. -// The timespec is absolute, using CLOCK_REALTIME. -struct timespec mp_rel_time_to_timespec(double timeout_sec); - #endif /* MPLAYER_TIMER_H */ |