mirror of
https://github.com/mpv-player/mpv
synced 2025-01-31 04:02:06 +00:00
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:
parent
326820b0ff
commit
5b7327920b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user