summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--streamer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/streamer.c b/streamer.c
index 5f8ac4eb..3642386f 100644
--- a/streamer.c
+++ b/streamer.c
@@ -1873,9 +1873,14 @@ streamer_thread (void *ctx) {
// add 1ms here to compensate the rounding error
// and another 1ms to buffer slightly faster then playing
alloc_time -= ms+2;
- if (streamer_buffering || streamer_ringbuf.remaining < STREAM_BUFFER_SIZE / 2) {
+ if (streamer_buffering) {
alloc_time = 0;
}
+ else if (streamer_ringbuf.remaining < STREAM_BUFFER_SIZE / 2) {
+ alloc_time >>= 2; // speed-up loading a little
+ }
+
+ //printf ("sleep: %d, buffering: %d, buffer_starving: %d (%d/%d)\n", alloc_time, streamer_buffering, streamer_ringbuf.remaining < STREAM_BUFFER_SIZE / 2, streamer_ringbuf.remaining, STREAM_BUFFER_SIZE / 2);
if (alloc_time > 0) {
usleep (alloc_time * 1000);