MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / AudioSyncFunction

Method AudioSyncFunction

Source/SysOSX/HLEAudio/AudioPluginOSX.cpp:277–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void AudioPluginOSX::AudioSyncFunction(void * arg)
278{
279 AudioPluginOSX * plugin = static_cast<AudioPluginOSX *>(arg);
280#if DEBUG_AUDIO
281 static u64 last_time = 0;
282 u64 now;
283 NTiming::GetPreciseTime(&now);
284 if (last_time == 0) last_time = now;
285 DPF_AUDIO("VBL: %dms elapsed. Audio buffer len %dms\n", (s32)NTiming::ToMilliseconds(now-last_time), plugin->mBufferLenMs);
286 last_time = now;
287#endif
288
289 u32 buffer_len = plugin->mBufferLenMs; // NB: copy this volatile to a local var so that we have a consistent view for the remainder of this function.
290 if (buffer_len > kMaxBufferLengthMs)
291 {
292 ThreadSleepMs(buffer_len - kMaxBufferLengthMs);
293 }
294}
295
296void AudioPluginOSX::StartAudio()
297{

Callers

nothing calls this directly

Calls 3

GetPreciseTimeFunction · 0.50
ToMillisecondsFunction · 0.50
ThreadSleepMsFunction · 0.50

Tested by

no test coverage detected