[player] Fix handling of underrun/read_deficit

* Also call full_cb() from input_wait if buffer is full
* Make read_deficit count missing bytes instead of clock ticks
* Make read_deficit a part of the playback session
This commit is contained in:
ejurgensen
2019-02-24 00:44:11 +01:00
parent 143708368c
commit 977f8570a5
2 changed files with 30 additions and 16 deletions

View File

@@ -477,6 +477,12 @@ input_wait(void)
// Is the buffer full?
if (evbuffer_get_length(input_buffer.evbuf) > INPUT_BUFFER_THRESHOLD)
{
if (input_buffer.full_cb)
{
input_buffer.full_cb();
input_buffer.full_cb = NULL;
}
pthread_mutex_unlock(&input_buffer.mutex);
return -1;
}