| 275 | } |
| 276 | |
| 277 | void 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 | |
| 296 | void AudioPluginOSX::StartAudio() |
| 297 | { |
nothing calls this directly
no test coverage detected