aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c10
-rw-r--r--Alc/alsa.c6
-rw-r--r--Alc/dsound.c2
-rw-r--r--Alc/oss.c4
-rw-r--r--Alc/solaris.c2
-rw-r--r--OpenAL32/Include/alMain.h4
6 files changed, 13 insertions, 15 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 5560e6e7..ca84476e 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -360,7 +360,7 @@ static const ALchar alExtList[] =
"AL_LOKI_quadriphonic";
// Mixing Priority Level
-ALint RTPrioLevel;
+static ALint RTPrioLevel;
// Resampler Quality
resampler_t DefaultResampler;
@@ -604,19 +604,19 @@ void al_print(const char *fname, unsigned int line, const char *fmt, ...)
fprintf(stderr, "%s", str);
}
-void EnableRTPrio(ALint level)
+void SetRTPriority(void)
{
ALboolean failed;
#ifdef _WIN32
- if(level > 0)
+ if(RTPrioLevel > 0)
failed = !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
else
failed = !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
#elif defined(HAVE_PTHREAD_SETSCHEDPARAM)
struct sched_param param;
- if(level > 0)
+ if(RTPrioLevel > 0)
{
/* Use the minimum real-time priority possible for now (on Linux this
* should be 1 for SCHED_RR) */
@@ -630,7 +630,7 @@ void EnableRTPrio(ALint level)
}
#else
/* Real-time priority not available */
- failed = !!level;
+ failed = (RTPrioLevel>0);
#endif
if(failed)
AL_PRINT("Failed to set priority level for thread\n");
diff --git a/Alc/alsa.c b/Alc/alsa.c
index debab873..eadafee8 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -358,7 +358,7 @@ static ALuint ALSAProc(ALvoid *ptr)
char *WritePtr;
int err;
- EnableRTPrio(RTPrioLevel);
+ SetRTPriority();
while(!data->killNow)
{
@@ -432,7 +432,7 @@ static ALuint ALSANoMMapProc(ALvoid *ptr)
snd_pcm_sframes_t avail;
char *WritePtr;
- EnableRTPrio(RTPrioLevel);
+ SetRTPriority();
while(!data->killNow)
{
@@ -488,7 +488,7 @@ static ALuint ALSANoMMapCaptureProc(ALvoid *ptr)
alsa_data *data = (alsa_data*)pDevice->ExtraData;
snd_pcm_sframes_t avail;
- EnableRTPrio(RTPrioLevel);
+ SetRTPriority();
while(!data->killNow)
{
diff --git a/Alc/dsound.c b/Alc/dsound.c
index 7894585d..29e5b1cd 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -163,7 +163,7 @@ static ALuint DSoundProc(ALvoid *ptr)
DWORD avail;
HRESULT err;
- EnableRTPrio(RTPrioLevel);
+ SetRTPriority();
memset(&DSBCaps, 0, sizeof(DSBCaps));
DSBCaps.dwSize = sizeof(DSBCaps);
diff --git a/Alc/oss.c b/Alc/oss.c
index 31367365..5fee7734 100644
--- a/Alc/oss.c
+++ b/Alc/oss.c
@@ -82,7 +82,7 @@ static ALuint OSSProc(ALvoid *ptr)
ALint frameSize;
ssize_t wrote;
- EnableRTPrio(RTPrioLevel);
+ SetRTPriority();
frameSize = aluChannelsFromFormat(pDevice->Format) *
aluBytesFromFormat(pDevice->Format);
@@ -124,7 +124,7 @@ static ALuint OSSCaptureProc(ALvoid *ptr)
int frameSize;
int amt;
- EnableRTPrio(RTPrioLevel);
+ SetRTPriority();
frameSize = aluBytesFromFormat(pDevice->Format);
frameSize *= aluChannelsFromFormat(pDevice->Format);
diff --git a/Alc/solaris.c b/Alc/solaris.c
index e60ac976..08ebdb4c 100644
--- a/Alc/solaris.c
+++ b/Alc/solaris.c
@@ -57,7 +57,7 @@ static ALuint SolarisProc(ALvoid *ptr)
ALint frameSize;
int wrote;
- EnableRTPrio(RTPrioLevel);
+ SetRTPriority();
frameSize = aluChannelsFromFormat(pDevice->Format) *
aluBytesFromFormat(pDevice->Format);
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index c40318a8..c1f06d65 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -439,8 +439,6 @@ struct ALCcontext_struct
ALCcontext *next;
};
-extern ALint RTPrioLevel;
-
ALCvoid ReleaseALC(ALCvoid);
void AppendDeviceList(const ALCchar *name);
@@ -472,7 +470,7 @@ int GetConfigValueInt(const char *blockName, const char *keyName, int def);
float GetConfigValueFloat(const char *blockName, const char *keyName, float def);
int GetConfigValueBool(const char *blockName, const char *keyName, int def);
-void EnableRTPrio(ALint level);
+void SetRTPriority(void);
void SetDefaultChannelOrder(ALCdevice *device);
void SetDefaultWFXChannelOrder(ALCdevice *device);