summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-01 21:57:53 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-01 21:57:53 +0100
commit62c5b7a461d8e7b4d73ed6fe2433f978e00a797a (patch)
treed7029e66aebab04d65e71c26c0bf785efc16b1ff /streamer.c
parente4d02091e16e2d577265a3c249dca7d184b11102 (diff)
Revert "minor change, might improve cpu load granularity"
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/streamer.c b/streamer.c
index 57e62635..ef8618e5 100644
--- a/streamer.c
+++ b/streamer.c
@@ -365,18 +365,16 @@ streamer_thread (uintptr_t ctx) {
// read ahead at 384K per second
// that means 10ms per 4k block, or 40ms per 16k block
- int minsize = 16484;
- int alloc_time = 1000 / (96000 * 4 / minsize);
+ int alloc_time = 1000 / (96000 * 4 / 4096);
streamer_lock ();
if (streambuffer_fill < (STREAM_BUFFER_SIZE-4096)/* && bytes_until_next_song == 0*/) {
int sz = STREAM_BUFFER_SIZE - streambuffer_fill;
-#if 0
+ int minsize = 4096;
if (streambuffer_fill < 16384) {
minsize = 16384;
alloc_time *= 4;
}
-#endif
sz = min (minsize, sz);
assert ((sz&3) == 0);
char buf[sz];
@@ -395,7 +393,7 @@ streamer_thread (uintptr_t ctx) {
if (alloc_time > 0) {
usleep (alloc_time * 1000);
}
-// printf ("fill: %d/%d\n", streambuffer_fill, STREAM_BUFFER_SIZE);
+// trace ("fill: %d/%d\n", streambuffer_fill, STREAM_BUFFER_SIZE);
}
// stop streaming song