summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-04-28 21:02:31 +0200
committerGravatar waker <wakeroid@gmail.com>2012-04-28 21:02:31 +0200
commitb384efade1e472fba8cac1efc5133b1f488572ab (patch)
tree3cc3ec0afb4113c217f0f901fb06966680160ac7 /streamer.c
parent4216a8f5f32e3ed47ffcc34640bbdb9d74326843 (diff)
fixed excessive cpu use when waiting for the last track to finish
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/streamer.c b/streamer.c
index 1c5241c5..ce381dee 100644
--- a/streamer.c
+++ b/streamer.c
@@ -1406,6 +1406,9 @@ streamer_thread (void *ctx) {
do {
int prev_buns = bytes_until_next_song;
int nb = streamer_read_async (readbuffer+bytesread,sz-bytesread);
+ if (nb <= 0) {
+ break;
+ }
bytesread += nb;
struct timeval tm2;
gettimeofday (&tm2, NULL);