[player] Better fix for resuming playback af long pause (issue #766)

The fix in commit 3928ab6 broke resuming from an underrun, since it meant that
pb_resume() would flush the input buffer. With this fix it is possible to call
input_resume(), which will not flush the buffer if the source is already open.

Also renamed some functions in player.c for consistency.
This commit is contained in:
ejurgensen
2019-07-12 19:11:48 +02:00
parent d7efd79e14
commit 3e9f8effa0
3 changed files with 66 additions and 16 deletions

View File

@@ -196,6 +196,17 @@ input_buffer_full_cb(input_cb cb);
int
input_seek(uint32_t item_id, int seek_ms);
/*
* Same as input_seek(), except if the item is already being read we don't do
* anything (no flush & seek)
*
* @in item_id Queue item id to start playing
* @in seek_ms Position to start playing
* @return Actual seek position if seekable, 0 otherwise, -1 on error
*/
int
input_resume(uint32_t item_id, int seek_ms);
/*
* Same as input_seek(), just non-blocking and does not offer seek.
*