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

Function ReleaseWasapiDevice

deps/SDL2/src/audio/wasapi/SDL_wasapi.c:423–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423static void
424ReleaseWasapiDevice(_THIS)
425{
426 if (this->hidden->client) {
427 IAudioClient_Stop(this->hidden->client);
428 IAudioClient_SetEventHandle(this->hidden->client, NULL);
429 IAudioClient_Release(this->hidden->client);
430 this->hidden->client = NULL;
431 }
432
433 if (this->hidden->render) {
434 IAudioRenderClient_Release(this->hidden->render);
435 this->hidden->render = NULL;
436 }
437
438 if (this->hidden->capture) {
439 IAudioCaptureClient_Release(this->hidden->capture);
440 this->hidden->capture = NULL;
441 }
442
443 if (this->hidden->waveformat) {
444 CoTaskMemFree(this->hidden->waveformat);
445 this->hidden->waveformat = NULL;
446 }
447
448 if (this->hidden->capturestream) {
449 SDL_FreeAudioStream(this->hidden->capturestream);
450 this->hidden->capturestream = NULL;
451 }
452
453 if (this->hidden->activation_handler) {
454 WASAPI_PlatformDeleteActivationHandler(this->hidden->activation_handler);
455 this->hidden->activation_handler = NULL;
456 }
457
458 if (this->hidden->event) {
459 CloseHandle(this->hidden->event);
460 this->hidden->event = NULL;
461 }
462}
463
464static void
465WASAPI_CloseDevice(_THIS)

Callers 2

RecoverWasapiDeviceFunction · 0.85
WASAPI_UnrefDeviceFunction · 0.85

Calls 2

SDL_FreeAudioStreamFunction · 0.85

Tested by

no test coverage detected