summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-09-08 04:37:52 -0700
committerChris Robinson <[email protected]>2014-09-08 04:37:52 -0700
commit2be33d8a771a77bbcdf5809ea980bc8586a4fe22 (patch)
tree84c98edb0b43996efd512bed250c4f8f4b8a9a12
parentf38e88bc297d3c7e61a503f2e00c26cbdd7b2009 (diff)
Only pass nano seconds to al_nssleep
-rw-r--r--Alc/backends/null.c2
-rw-r--r--Alc/backends/oss.c4
-rw-r--r--Alc/backends/solaris.c2
-rw-r--r--Alc/backends/wave.c2
-rw-r--r--common/threads.c6
-rw-r--r--include/threads.h2
6 files changed, 9 insertions, 9 deletions
diff --git a/Alc/backends/null.c b/Alc/backends/null.c
index 9dc90288..7010f41c 100644
--- a/Alc/backends/null.c
+++ b/Alc/backends/null.c
@@ -106,7 +106,7 @@ static int ALCnullBackend_mixerProc(void *ptr)
}
if(avail-done < device->UpdateSize)
- al_nssleep(0, restTime);
+ al_nssleep(restTime);
else while(avail-done >= device->UpdateSize)
{
aluMixData(device, NULL, device->UpdateSize);
diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c
index 8c61ba93..631a496e 100644
--- a/Alc/backends/oss.c
+++ b/Alc/backends/oss.c
@@ -131,7 +131,7 @@ static int ALCplaybackOSS_mixerProc(void *ptr)
break;
}
- al_nssleep(0, 1000000);
+ al_nssleep(1000000);
continue;
}
@@ -362,7 +362,7 @@ static int ALCcaptureOSS_recordProc(void *ptr)
}
if(amt == 0)
{
- al_nssleep(0, 1000000);
+ al_nssleep(1000000);
continue;
}
if(self->doCapture)
diff --git a/Alc/backends/solaris.c b/Alc/backends/solaris.c
index b29fdea1..5d51d460 100644
--- a/Alc/backends/solaris.c
+++ b/Alc/backends/solaris.c
@@ -86,7 +86,7 @@ static int SolarisProc(void *ptr)
break;
}
- al_nssleep(0, 1000000);
+ al_nssleep(1000000);
continue;
}
diff --git a/Alc/backends/wave.c b/Alc/backends/wave.c
index ef1c307b..c80e059d 100644
--- a/Alc/backends/wave.c
+++ b/Alc/backends/wave.c
@@ -159,7 +159,7 @@ static int ALCwaveBackend_mixerProc(void *ptr)
}
if(avail-done < device->UpdateSize)
- al_nssleep(0, restTime);
+ al_nssleep(restTime);
else while(avail-done >= device->UpdateSize)
{
aluMixData(device, self->mBuffer, device->UpdateSize);
diff --git a/common/threads.c b/common/threads.c
index c4593604..71fa6ab9 100644
--- a/common/threads.c
+++ b/common/threads.c
@@ -733,11 +733,11 @@ int altimespec_get(struct timespec *ts, int base)
#endif
-void al_nssleep(time_t sec, long nsec)
+void al_nssleep(unsigned long nsec)
{
struct timespec ts, rem;
- ts.tv_sec = sec;
- ts.tv_nsec = nsec;
+ ts.tv_sec = nsec / 1000000000ul;
+ ts.tv_nsec = nsec % 1000000000ul;
while(althrd_sleep(&ts, &rem) == -1)
ts = rem;
diff --git a/include/threads.h b/include/threads.h
index 25a75625..75eeb13f 100644
--- a/include/threads.h
+++ b/include/threads.h
@@ -234,7 +234,7 @@ void altss_delete(altss_t tss_id);
int altimespec_get(struct timespec *ts, int base);
-void al_nssleep(time_t sec, long nsec);
+void al_nssleep(unsigned long nsec);
#ifdef __cplusplus
}