X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=osx_write.c;h=f13ec6e1988e00ebce5a9639167650fceea24d6d;hp=4ba173a70200ebd269e2b3602e6b9d609be9df8b;hb=a7a37b282c4e936b2fb34c2bd7423f9f800dfd44;hpb=505cfe0c6c8f9ef79d259ee64404ab40f2057081 diff --git a/osx_write.c b/osx_write.c index 4ba173a7..f13ec6e1 100644 --- a/osx_write.c +++ b/osx_write.c @@ -111,14 +111,8 @@ static void fill_buffer(struct osx_buffer *b, short *source, long size) b->size = size; } dest = b->buffer; - while (size--) { - char *tmp = (char *)source; - char c = *tmp; - *tmp = *(tmp + 1); - *(tmp + 1) = c; - /* *dest++ = ((*source++) + 32768) / 65536.0; */ + while (size--) *dest++ = (*source++) / 32768.0; - } b->ptr = b->buffer; b->remaining = b->size; } @@ -143,10 +137,7 @@ static OSStatus osx_callback(void * inClientData, while (m > 0) { if ((n = powd->from->remaining) <= 0) { PARA_INFO_LOG("%s", "buffer underrun\n"); - /* no more bytes in the current read buffer! */ - while ((n = powd->from->remaining) <= 0) - /* wait for the results */ - usleep(2000); + return 0; } // PARA_INFO_LOG("buf %p: n = %ld, m= %ld\n", powd->from->buffer, n, m); /*