MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / wasapiCleanup

Function wasapiCleanup

extlibs/soloud/src/backend/wasapi/soloud_wasapi.cpp:96–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 }
95
96 static void wasapiCleanup(Soloud *aSoloud)
97 {
98 if (0 == aSoloud->mBackendData)
99 {
100 return;
101 }
102 WASAPIData *data = static_cast<WASAPIData*>(aSoloud->mBackendData);
103 SetEvent(data->audioProcessingDoneEvent);
104 SetEvent(data->bufferEndEvent);
105 if (data->thread)
106 {
107 Thread::wait(data->thread);
108 Thread::release(data->thread);
109 }
110 CloseHandle(data->bufferEndEvent);
111 CloseHandle(data->audioProcessingDoneEvent);
112 if (0 != data->audioClient)
113 {
114 data->audioClient->Stop();
115 }
116 SAFE_RELEASE(data->renderClient);
117 SAFE_RELEASE(data->audioClient);
118 SAFE_RELEASE(data->device);
119 SAFE_RELEASE(data->deviceEnumerator);
120 delete data;
121 aSoloud->mBackendData = 0;
122 CoUninitialize();
123 }
124
125 result wasapi_init(Soloud *aSoloud, unsigned int aFlags, unsigned int aSamplerate, unsigned int aBuffer, unsigned int aChannels)
126 {

Callers

nothing calls this directly

Calls 2

waitFunction · 0.85
releaseFunction · 0.85

Tested by

no test coverage detected