mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
modernize pa_msleep() a bit
This commit is contained in:
parent
9cbdd3a968
commit
e1608d5db2
1 changed files with 4 additions and 2 deletions
|
|
@ -54,6 +54,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <pulse/xmalloc.h>
|
#include <pulse/xmalloc.h>
|
||||||
|
#include <pulse/timeval.h>
|
||||||
|
|
||||||
#include <pulsecore/winsock.h>
|
#include <pulsecore/winsock.h>
|
||||||
#include <pulsecore/core-error.h>
|
#include <pulsecore/core-error.h>
|
||||||
#include <pulsecore/log.h>
|
#include <pulsecore/log.h>
|
||||||
|
|
@ -260,8 +262,8 @@ int pa_msleep(unsigned long t) {
|
||||||
#elif defined(HAVE_NANOSLEEP)
|
#elif defined(HAVE_NANOSLEEP)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
ts.tv_sec = (time_t) (t/1000UL);
|
ts.tv_sec = (time_t) (t / PA_MSEC_PER_SEC);
|
||||||
ts.tv_nsec = (long) ((t % 1000UL) * 1000000UL);
|
ts.tv_nsec = (long) ((t % PA_MSEC_PER_SEC) * PA_NSEC_PER_MSEC);
|
||||||
|
|
||||||
return nanosleep(&ts, NULL);
|
return nanosleep(&ts, NULL);
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue