diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-08-14 18:30:48 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-08-14 18:30:48 +0200 |
commit | ed321f2f97b7b9a44fee7846bc15dd31b70241e3 (patch) | |
tree | 5029d5a2cc5190d71bd58c35e844eba59bea33ab /streamer.c | |
parent | 06c9fe1c21c7de0c9985dff30891d6cf64ed46b8 (diff) |
fixing crashbug in mp3 streaming WIP
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -40,7 +40,7 @@ static int streaming_terminate; #define STREAM_BUFFER_SIZE 200000 static int streambuffer_fill; -static char streambuffer[STREAM_BUFFER_SIZE+1000]; +static char streambuffer[STREAM_BUFFER_SIZE]; static uintptr_t mutex; static int nextsong = -1; static int nextsong_pstate = -1; @@ -120,16 +120,17 @@ streamer_thread (uintptr_t ctx) { if (streambuffer_fill < STREAM_BUFFER_SIZE) { int sz = STREAM_BUFFER_SIZE - streambuffer_fill; int minsize = 512; - if (streambuffer_fill < 16384) { +// if (streambuffer_fill < 16384) { minsize = 16384; - } +// } sz = min (minsize, sz); + assert ((sz&3) == 0); int bytesread = streamer_read_async (&streambuffer[streambuffer_fill], sz); //printf ("req=%d, got=%d\n", sz, bytesread); streambuffer_fill += bytesread; } streamer_unlock (); - usleep (2000); + usleep (6000); //printf ("fill: %d \r", streambuffer_fill); } |