diff options
author | 2009-11-01 21:48:03 +0100 | |
---|---|---|
committer | 2009-11-01 21:48:03 +0100 | |
commit | 4953a4febf7d42c409a8b3af5200504c96543308 (patch) | |
tree | 5b51625208c1ec7e47d8c8ca6cb69a801375ba6c /streamer.c | |
parent | 36e46bec30e574f32f1c078a7156e3ba00a8df0b (diff) |
minor change, might improve cpu load granularity
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -365,16 +365,18 @@ streamer_thread (uintptr_t ctx) { // read ahead at 384K per second // that means 10ms per 4k block, or 40ms per 16k block - int alloc_time = 1000 / (96000 * 4 / 4096); + int minsize = 16484; + int alloc_time = 1000 / (96000 * 4 / minsize); streamer_lock (); if (streambuffer_fill < (STREAM_BUFFER_SIZE-4096)/* && bytes_until_next_song == 0*/) { int sz = STREAM_BUFFER_SIZE - streambuffer_fill; - int minsize = 4096; +#if 0 if (streambuffer_fill < 16384) { minsize = 16384; alloc_time *= 4; } +#endif sz = min (minsize, sz); assert ((sz&3) == 0); char buf[sz]; @@ -393,7 +395,7 @@ streamer_thread (uintptr_t ctx) { if (alloc_time > 0) { usleep (alloc_time * 1000); } -// trace ("fill: %d/%d\n", streambuffer_fill, STREAM_BUFFER_SIZE); +// printf ("fill: %d/%d\n", streambuffer_fill, STREAM_BUFFER_SIZE); } // stop streaming song |