[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:
ejurgensen
2019-08-28 22:23:11 +02:00
parent ef0a194644
commit ef9c0117c9
4 changed files with 45 additions and 42 deletions

View File

@@ -143,21 +143,12 @@ int
input_write(struct evbuffer *evbuf, struct media_quality *quality, short flags);
/*
* Input modules can use this to wait for the input_buffer to be ready for
* writing. The wait is max INPUT_LOOP_TIMEOUT, which allows the event base to
* loop and process pending commands once in a while.
* Input modules can use this to wait for the player to read, so the module's
* playback-loop doesn't spin out of control.
*/
int
input_wait(void);
/*
* Async switch to the next song in the queue. Mostly for internal use, but
* might be relevant some day externally?
*/
//void
//input_next(void);
/* ---------------------- Interface towards player thread ------------------- */
/* Thread: player */