diff options
author | Chris Robinson <[email protected]> | 2010-05-12 07:27:12 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-05-12 07:27:12 -0700 |
commit | a53e3dda75f329f6f2060e8e760a1a4f7edbe45a (patch) | |
tree | 38104808dcb3033975a7cb55e95ab77e974cb7aa | |
parent | 2220c22c907026d8f4229ebf8b9eb75fb29810c9 (diff) |
Don't needlessly expose a variable for the backends
-rw-r--r-- | Alc/ALc.c | 10 | ||||
-rw-r--r-- | Alc/alsa.c | 6 | ||||
-rw-r--r-- | Alc/dsound.c | 2 | ||||
-rw-r--r-- | Alc/oss.c | 4 | ||||
-rw-r--r-- | Alc/solaris.c | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 4 |
6 files changed, 13 insertions, 15 deletions
@@ -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"); @@ -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); @@ -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); |