MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SDL_QueueAudio

Function SDL_QueueAudio

deps/SDL2/src/audio/SDL_audio.c:597–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595}
596
597int
598SDL_QueueAudio(SDL_AudioDeviceID devid, const void *data, Uint32 len)
599{
600 SDL_AudioDevice *device = get_audio_device(devid);
601 int rc = 0;
602
603 if (!device) {
604 return -1; /* get_audio_device() will have set the error state */
605 } else if (device->iscapture) {
606 return SDL_SetError("This is a capture device, queueing not allowed");
607 } else if (device->callbackspec.callback != SDL_BufferQueueDrainCallback) {
608 return SDL_SetError("Audio device has a callback, queueing not allowed");
609 }
610
611 if (len > 0) {
612 current_audio.impl.LockDevice(device);
613 rc = SDL_WriteToDataQueue(device->buffer_queue, data, len);
614 current_audio.impl.UnlockDevice(device);
615 }
616
617 return rc;
618}
619
620Uint32
621SDL_DequeueAudio(SDL_AudioDeviceID devid, void *data, Uint32 len)

Callers 2

loopFunction · 0.85
loopFunction · 0.85

Calls 3

SDL_SetErrorFunction · 0.85
SDL_WriteToDataQueueFunction · 0.85
get_audio_deviceFunction · 0.70

Tested by 2

loopFunction · 0.68
loopFunction · 0.68