ao_coreaudio: use 0 as timeout for CFRunLoopRunInMode

Handle all pending events and exit instead of waiting. When there are lots of
input events (for example, scrolling with trackpad), timeout can add up
to make a huge frame delay. In my tests, if I scroll fast enough, that loop
would never exit.
This commit is contained in:
Mad Fish
2013-01-20 16:37:30 +01:00
parent 326820b0ff
commit 5b7327920b
+1 -1
View File
@@ -1104,7 +1104,7 @@ static int play(void* output_samples,int num_bytes,int flags)
audio_resume();
do {
exit_reason = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.01, true);
exit_reason = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
} while (exit_reason == kCFRunLoopRunHandledSource);
return wrote;