Skip to content

Commit

Permalink
sokol_audio.h: minor code cleanup, and fix a confused prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Nov 24, 2020
1 parent 4aef206 commit 78dd4e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sokol_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ _SOKOL_PRIVATE void _saudio_backend_shutdown(void) { };
#elif defined(__APPLE__)

/* NOTE: the buffer data callback is called on a separate thread! */
_SOKOL_PRIVATE void _sapp_ca_callback(void* user_data, AudioQueueRef queue, AudioQueueBufferRef buffer) {
_SOKOL_PRIVATE void _saudio_coreaudio_callback(void* user_data, AudioQueueRef queue, AudioQueueBufferRef buffer) {
_SOKOL_UNUSED(user_data);
if (_saudio_has_callback()) {
const int num_frames = buffer->mAudioDataByteSize / _saudio.bytes_per_frame;
Expand Down Expand Up @@ -996,7 +996,7 @@ _SOKOL_PRIVATE bool _saudio_backend_init(void) {
fmt.mBytesPerFrame = sizeof(float) * _saudio.num_channels;
fmt.mBytesPerPacket = fmt.mBytesPerFrame;
fmt.mBitsPerChannel = 32;
OSStatus res = AudioQueueNewOutput(&fmt, _sapp_ca_callback, 0, NULL, NULL, 0, &_saudio.backend.ca_audio_queue);
OSStatus res = AudioQueueNewOutput(&fmt, _saudio_coreaudio_callback, 0, NULL, NULL, 0, &_saudio.backend.ca_audio_queue);
SOKOL_ASSERT((res == 0) && _saudio.backend.ca_audio_queue);

/* create 2 audio buffers */
Expand Down Expand Up @@ -1056,15 +1056,15 @@ _SOKOL_PRIVATE void* _saudio_alsa_cb(void* param) {
}

_SOKOL_PRIVATE bool _saudio_backend_init(void) {
int dir; unsigned int rate;
int dir; unsigned int rate;
int rc = snd_pcm_open(&_saudio.backend.device, "default", SND_PCM_STREAM_PLAYBACK, 0);
if (rc < 0) {
SOKOL_LOG("sokol_audio.h: snd_pcm_open() failed");
return false;
}

/* configuration works by restricting the 'configuration space' step
by step, we require all parameters except the sample rate to
/* configuration works by restricting the 'configuration space' step
by step, we require all parameters except the sample rate to
match perfectly
*/
snd_pcm_hw_params_t* params = 0;
Expand Down

0 comments on commit 78dd4e2

Please sign in to comment.