summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-08-14 18:30:48 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-08-14 18:30:48 +0200
commited321f2f97b7b9a44fee7846bc15dd31b70241e3 (patch)
tree5029d5a2cc5190d71bd58c35e844eba59bea33ab /streamer.c
parent06c9fe1c21c7de0c9985dff30891d6cf64ed46b8 (diff)
fixing crashbug in mp3 streaming WIP
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/streamer.c b/streamer.c
index 936fc808..caae48b1 100644
--- a/streamer.c
+++ b/streamer.c
@@ -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);
}