mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 21:49:48 -05:00
[input] Fix pipe playback bringing cpu to 100%
When pipe playback is started, but no data is written to the pipe, the input loop would bring the cpu to 100%. This fix limits the loop like it was before player refactor.
This commit is contained in:
@@ -87,10 +87,6 @@ play(struct input_source *source)
|
||||
int ret;
|
||||
short flags;
|
||||
|
||||
ret = input_wait();
|
||||
if (ret < 0)
|
||||
return 0; // Loop, input_buffer is not ready for writing
|
||||
|
||||
// We set "wanted" to 1 because the read size doesn't matter to us
|
||||
// TODO optimize?
|
||||
ret = transcode(source->evbuf, &icy_timer, ctx, 1);
|
||||
|
||||
@@ -872,10 +872,6 @@ play(struct input_source *source)
|
||||
short flags;
|
||||
int ret;
|
||||
|
||||
ret = input_wait();
|
||||
if (ret < 0)
|
||||
return 0; // Loop, input_buffer is not ready for writing
|
||||
|
||||
ret = evbuffer_read(source->evbuf, pipe->fd, PIPE_READ_MAX);
|
||||
if ((ret == 0) && (pipe->is_autostarted))
|
||||
{
|
||||
@@ -885,6 +881,7 @@ play(struct input_source *source)
|
||||
}
|
||||
else if ((ret == 0) || ((ret < 0) && (errno == EAGAIN)))
|
||||
{
|
||||
input_wait();
|
||||
return 0; // Loop
|
||||
}
|
||||
else if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user