diff options
| author | Andre Weissflog <floooh@gmail.com> | 2020-11-24 12:16:05 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2020-11-24 12:16:05 +0100 |
| commit | 78dd4e284027d9cdd9437c800bc4af570db8d032 (patch) | |
| tree | ac56a4fbeab34c080ec162966d260eaf6229d591 | |
| parent | 4aef20682bf70e3a3f3dc3634bcce902fd600b08 (diff) | |
sokol_audio.h: minor code cleanup, and fix a confused prefix
| -rw-r--r-- | sokol_audio.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sokol_audio.h b/sokol_audio.h index 8df5813b..20f0fd79 100644 --- a/sokol_audio.h +++ b/sokol_audio.h @@ -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; @@ -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 */ @@ -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; |