Skip to content

Commit

Permalink
Tweaked a couple comments, added some FIXMEs.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 18, 2015
1 parent 1110f53 commit 97ff10c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/audio/SDL_audio.c
Expand Up @@ -616,6 +616,7 @@ SDL_RunAudio(void *devicep)
}

/* Read from the callback into the _input_ stream */
// !!! FIXME: this should be LockDevice.
SDL_LockMutex(device->mixer_lock);
(*fill) (udata, istream, istream_len);
SDL_UnlockMutex(device->mixer_lock);
Expand Down Expand Up @@ -687,6 +688,7 @@ SDL_RunAudio(void *devicep)
}
}

/* !!! FIXME: this should be LockDevice. */
SDL_LockMutex(device->mixer_lock);
if (device->paused) {
SDL_memset(stream, silence, stream_len);
Expand Down Expand Up @@ -1138,7 +1140,7 @@ open_audio_device(const char *devname, int iscapture,
device->paused = 1;
device->iscapture = iscapture;

/* Create a semaphore for locking the sound buffers */
/* Create a mutex for locking the sound buffers */
if (!current_audio.impl.SkipMixerLock) {
device->mixer_lock = SDL_CreateMutex();
if (device->mixer_lock == NULL) {
Expand Down
4 changes: 3 additions & 1 deletion src/audio/SDL_sysaudio.h
Expand Up @@ -71,6 +71,7 @@ typedef struct SDL_AudioDriverImpl
/* !!! FIXME: add pause(), so we can optimize instead of mixing silence. */

/* Some flags to push duplicate code into the core and reduce #ifdefs. */
/* !!! FIXME: these should be SDL_bool */
int ProvidesOwnCallbackThread;
int SkipMixerLock; /* !!! FIXME: do we need this anymore? */
int HasCaptureSupport;
Expand Down Expand Up @@ -125,6 +126,7 @@ struct SDL_AudioDevice
SDL_AudioStreamer streamer;

/* Current state flags */
/* !!! FIXME: should be SDL_bool */
int iscapture;
int enabled;
int paused;
Expand All @@ -133,7 +135,7 @@ struct SDL_AudioDevice
/* Fake audio buffer for when the audio hardware is busy */
Uint8 *fake_stream;

/* A semaphore for locking the mixing buffers */
/* A mutex for locking the mixing buffers */
SDL_mutex *mixer_lock;

/* A thread to feed the audio device */
Expand Down

0 comments on commit 97ff10c

Please sign in to comment.