summaryrefslogtreecommitdiffhomepage
path: root/src/audio.c
diff options
context:
space:
mode:
authorDavid Reid <[email protected]>2017-11-18 12:15:48 +1000
committerDavid Reid <[email protected]>2017-11-18 12:15:48 +1000
commitf9144ac5b0bc59e69d87ee8b67047888873418fc (patch)
tree1776df213a354392dd08a68190c19f5be64cf329 /src/audio.c
parent3be83dac7edebd58ab02814b634eb053377f954f (diff)
downloadraylib-f9144ac5b0bc59e69d87ee8b67047888873418fc.tar.gz
raylib-f9144ac5b0bc59e69d87ee8b67047888873418fc.zip
Rename a variable for consistency.
Diffstat (limited to 'src/audio.c')
-rw-r--r--src/audio.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/audio.c b/src/audio.c
index 5bff9a0c..5209cc56 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -240,13 +240,13 @@ static mal_context context;
static mal_device device;
static mal_bool32 isAudioInitialized = MAL_FALSE;
static float masterVolume = 1;
-static mal_mutex soundLock;
+static mal_mutex audioLock;
static AudioBuffer* firstAudioBuffer = NULL; // Audio buffers are tracked in a linked list.
static AudioBuffer* lastAudioBuffer = NULL;
static void TrackAudioBuffer(AudioBuffer* audioBuffer)
{
- mal_mutex_lock(&soundLock);
+ mal_mutex_lock(&audioLock);
{
if (firstAudioBuffer == NULL) {
firstAudioBuffer = audioBuffer;
@@ -257,12 +257,12 @@ static void TrackAudioBuffer(AudioBuffer* audioBuffer)
lastAudioBuffer = audioBuffer;
}
- mal_mutex_unlock(&soundLock);
+ mal_mutex_unlock(&audioLock);
}
static void UntrackAudioBuffer(AudioBuffer* audioBuffer)
{
- mal_mutex_lock(&soundLock);
+ mal_mutex_lock(&audioLock);
{
if (audioBuffer->prev == NULL) {
firstAudioBuffer = audioBuffer->next;
@@ -279,7 +279,7 @@ static void UntrackAudioBuffer(AudioBuffer* audioBuffer)
audioBuffer->prev = NULL;
audioBuffer->next = NULL;
}
- mal_mutex_unlock(&soundLock);
+ mal_mutex_unlock(&audioLock);
}
static void OnLog_MAL(mal_context* pContext, mal_device* pDevice, const char* message)
@@ -314,7 +314,7 @@ static mal_uint32 OnSendAudioDataToDevice(mal_device* pDevice, mal_uint32 frameC
// Using a mutex here for thread-safety which makes things not real-time. This is unlikely to be necessary for this project, but may
// want to consider how you might want to avoid this.
- mal_mutex_lock(&soundLock);
+ mal_mutex_lock(&audioLock);
{
for (AudioBuffer* audioBuffer = firstAudioBuffer; audioBuffer != NULL; audioBuffer = audioBuffer->next)
{
@@ -378,7 +378,7 @@ static mal_uint32 OnSendAudioDataToDevice(mal_device* pDevice, mal_uint32 frameC
}
}
}
- mal_mutex_unlock(&soundLock);
+ mal_mutex_unlock(&audioLock);
return frameCount; // We always output the same number of frames that were originally requested.
}
@@ -417,7 +417,7 @@ void InitAudioDevice(void)
// Mixing happens on a seperate thread which means we need to synchronize. I'm using a mutex here to make things simple, but may
// want to look at something a bit smarter later on to keep everything real-time, if that's necessary.
- if (mal_mutex_init(&context, &soundLock) != MAL_SUCCESS)
+ if (mal_mutex_init(&context, &audioLock) != MAL_SUCCESS)
{
TraceLog(LOG_ERROR, "Failed to create mutex for audio mixing");
mal_device_uninit(&device);
@@ -479,7 +479,7 @@ void CloseAudioDevice(void)
return;
}
- mal_mutex_uninit(&soundLock);
+ mal_mutex_uninit(&audioLock);
mal_device_uninit(&device);
mal_context_uninit(&context);
#else