diff options
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/timer.c | 6 | ||||
-rw-r--r-- | osdep/timer.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/osdep/timer.c b/osdep/timer.c index 8a52823b0f..0943ab3871 100644 --- a/osdep/timer.c +++ b/osdep/timer.c @@ -85,7 +85,7 @@ static void get_realtime(struct timespec *out_ts) #endif } -struct timespec mp_time_us_to_timespec(int64_t time_us) +struct timespec mp_time_us_to_realtime(int64_t time_us) { struct timespec ts; get_realtime(&ts); @@ -112,7 +112,7 @@ struct timespec mp_time_us_to_timespec(int64_t time_us) struct timespec mp_rel_time_to_timespec(double timeout_sec) { - return mp_time_us_to_timespec(mp_add_timeout(mp_time_us(), timeout_sec)); + return mp_time_us_to_realtime(mp_add_timeout(mp_time_us(), timeout_sec)); } #if 0 @@ -137,7 +137,7 @@ int main(void) { #if TEST_SLEEP mp_sleep_us(delay); #else - struct timespec ts = mp_time_us_to_timespec(r + delay); + struct timespec ts = mp_time_us_to_realtime(r + delay); pthread_cond_timedwait(&cnd, &mtx, &ts); #endif j = (mp_time_us() - r) - delay; diff --git a/osdep/timer.h b/osdep/timer.h index 8cc1d9dc27..b98c275697 100644 --- a/osdep/timer.h +++ b/osdep/timer.h @@ -55,7 +55,7 @@ void mp_end_hires_timers(int resolution_ms); int64_t mp_add_timeout(int64_t time_us, double timeout_sec); // Convert the mp time in microseconds to a timespec using CLOCK_REALTIME. -struct timespec mp_time_us_to_timespec(int64_t time_us); +struct timespec mp_time_us_to_realtime(int64_t time_us); // Convert the relative timeout in seconds to a timespec. // The timespec is absolute, using CLOCK_REALTIME. |