MCPcopy Create free account
hub / github.com/defold/defold / DeviceOpenSLClose

Function DeviceOpenSLClose

engine/sound/src/devices/device_opensl.cpp:364–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362 }
363
364 void DeviceOpenSLClose(dmSound::HDevice device)
365 {
366 assert(device);
367 OpenSLDevice* opensl = (OpenSLDevice*) device;
368 dmMutex::Lock(opensl->m_Mutex);
369
370 SLresult res = (*opensl->m_Play)->SetPlayState(opensl->m_Play, SL_PLAYSTATE_STOPPED);
371 CheckAndPrintError(res);
372
373 (*opensl->m_BufferQueue)->Clear(opensl->m_BufferQueue);
374 (*opensl->m_Player)->Destroy(opensl->m_Player);
375 (*opensl->m_OutputMix)->Destroy(opensl->m_OutputMix);
376 (*opensl->m_SL)->Destroy(opensl->m_SL);
377
378 while (opensl->m_Free.Size() > 0) {
379 Buffer b = opensl->m_Free.Pop();
380 free(b.m_Buffer);
381 }
382
383 dmMutex::Unlock(opensl->m_Mutex);
384 dmMutex::Delete(opensl->m_Mutex);
385
386 delete opensl;
387 }
388
389 dmSound::Result DeviceOpenSLQueue(dmSound::HDevice device, const void* samples, uint32_t sample_count)
390 {

Callers

nothing calls this directly

Calls 10

freeFunction · 0.85
CheckAndPrintErrorFunction · 0.70
assertFunction · 0.50
LockFunction · 0.50
UnlockFunction · 0.50
DeleteFunction · 0.50
ClearMethod · 0.45
DestroyMethod · 0.45
SizeMethod · 0.45
PopMethod · 0.45

Tested by

no test coverage detected