mirror of
https://github.com/libretro/RetroArch
synced 2025-03-13 07:14:43 +00:00
Should fix high CPU bug in Pulse. (Thanks to fable2012).
This commit is contained in:
parent
00fd46c0f6
commit
8fed2d1efb
@ -182,18 +182,15 @@ static ssize_t pulse_write(void *data, const void *buf, size_t size)
|
||||
size_t length = pa_stream_writable_size(pa->stream);
|
||||
pa_threaded_mainloop_unlock(pa->mainloop);
|
||||
|
||||
while (length < size)
|
||||
while (length < size && !pa->nonblock)
|
||||
{
|
||||
pa_threaded_mainloop_wait(pa->mainloop);
|
||||
pa_threaded_mainloop_lock(pa->mainloop);
|
||||
pa_threaded_mainloop_wait(pa->mainloop);
|
||||
length = pa_stream_writable_size(pa->stream);
|
||||
pa_threaded_mainloop_unlock(pa->mainloop);
|
||||
|
||||
if (pa->nonblock)
|
||||
break;
|
||||
}
|
||||
|
||||
size_t write_size = length < size ? length : size;
|
||||
size_t write_size = min(length, size);
|
||||
|
||||
pa_threaded_mainloop_lock(pa->mainloop);
|
||||
pa_stream_write(pa->stream, buf, write_size, NULL, 0LL, PA_SEEK_RELATIVE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user