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

Function alsaCleanup

extlibs/soloud/src/backend/alsa/soloud_alsa.cpp:81–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79 }
80
81 static void alsaCleanup(Soloud *aSoloud)
82 {
83 if (0 == aSoloud->mBackendData)
84 {
85 return;
86 }
87 ALSAData *data = static_cast<ALSAData*>(aSoloud->mBackendData);
88 data->audioProcessingDone = true;
89 if (data->threadHandle)
90 {
91 Thread::wait(data->threadHandle);
92 Thread::release(data->threadHandle);
93 }
94 snd_pcm_drain(data->alsaDeviceHandle);
95 snd_pcm_close(data->alsaDeviceHandle);
96 if (0 != data->sampleBuffer)
97 {
98 delete[] data->sampleBuffer;
99 }
100 if (0 != data->buffer)
101 {
102 delete[] data->buffer;
103 }
104 delete data;
105 aSoloud->mBackendData = 0;
106 }
107
108 result alsa_init(Soloud *aSoloud, unsigned int aFlags, unsigned int aSamplerate, unsigned int aBuffer, unsigned int aChannels)
109 {

Callers

nothing calls this directly

Calls 2

waitFunction · 0.85
releaseFunction · 0.85

Tested by

no test coverage detected