pkgsrc/audio/muse/patches/patch-ac
2005-12-11 23:44:40 +00:00

136 lines
4 KiB
Text

$NetBSD: patch-ac,v 1.3 2005/12/11 23:44:40 joerg Exp $
--- src/pipe.cpp.orig 2003-12-08 12:20:33.000000000 +0000
+++ src/pipe.cpp
@@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA.
#include <iostream>
#include <stdlib.h>
+#include <errno.h>
#include <audioproc.h>
#include <pipe.h>
#include <jutils.h>
@@ -61,7 +62,7 @@ Pipe::Pipe(int size) {
end=start=buffer;
blocking = true;
_thread_init();
- unlock();
+ //unlock();
}
Pipe::~Pipe() {
@@ -118,9 +119,9 @@ int Pipe::read_float_intl(int samples, f
}
/* --- */
- (char*)start += currentBlockSize;
+ start = (char*)start + currentBlockSize;
len -= currentBlockSize;
- (char*)pp += currentBlockSize;
+ pp = (float *)((char*)pp + currentBlockSize);
length -= currentBlockSize;
if ((end!=buffer) && (start==bufferEnd))
start = buffer;
@@ -146,8 +147,8 @@ int Pipe::read_float_intl(int samples, f
}
/* --- */
- (char*)pp += len;
- (char*)start += len;
+ pp = (float *)((char*)pp + len);
+ start = (char*)start + len;
length -= len;
if ((end!=buffer) && (start==bufferEnd))
start = buffer;
@@ -224,9 +225,9 @@ int Pipe::read_float_bidi(int samples, f
}
/* --- */
- (char*)start += currentBlockSize;
+ start = (char*)start + currentBlockSize;
len -= currentBlockSize;
- (char*)pp += currentBlockSize;
+ pp = (float **)((char*)pp + currentBlockSize);
length -= currentBlockSize;
if ((end!=buffer) && (start==bufferEnd))
start = buffer;
@@ -253,8 +254,8 @@ int Pipe::read_float_bidi(int samples, f
}
/* --- */
- (char*)pp += len;
- (char*)start += len;
+ pp = (float **)((char*)pp + len);
+ start = (char*)start + len;
length -= len;
if ((end!=buffer) && (start==bufferEnd))
start = buffer;
@@ -309,9 +310,9 @@ int Pipe::mix16stereo(int samples, int32
pp[c] += (int32_t) ((IN_DATATYPE*)start)[c];
/* --- */
- (char*)start += currentBlockSize;
+ start = (char*)start + currentBlockSize;
len -= currentBlockSize;
- (char*)pp += currentBlockSize;
+ pp = (int32_t *)((char*)pp + currentBlockSize);
length -= currentBlockSize;
if ((end!=buffer) && (start==bufferEnd))
start = buffer;
@@ -324,8 +325,8 @@ int Pipe::mix16stereo(int samples, int32
pp[c] += (int) ((IN_DATATYPE*)start)[c];
/* --- */
- (char*)pp += len;
- (char*)start += len;
+ pp = (int32_t *)((char*)pp + len);
+ start = (char*)start + len;
length -= len;
if ((end!=buffer) && (start==bufferEnd))
start = buffer;
@@ -372,17 +373,17 @@ int Pipe::read(int length, void *data) {
/* fill */
memcpy(data, start, currentBlockSize);
- (char*)start += currentBlockSize;
+ start = (char*)start + currentBlockSize;
len -= currentBlockSize;
- (char*)data += currentBlockSize;
+ data = (char*)data + currentBlockSize;
length -= currentBlockSize;
if ((end!=buffer) && (start==bufferEnd))
start = buffer;
if (len) { /* short circuit */
memcpy(data, start, len);
- (char*)data += len;
- (char*)start += len;
+ data = (char*)data + len;
+ start = (char*)start + len;
length -= len;
if ((end!=buffer) && (start==bufferEnd))
start = buffer;
@@ -418,19 +419,19 @@ int Pipe::write(int length, void *data)
currentBlockSize=MIN(currentBlockSize, len);
::memcpy(end, data, currentBlockSize);
- (char*)end += currentBlockSize;
+ end = (char*)end + currentBlockSize;
len -= currentBlockSize;
- (char*)data += currentBlockSize;
+ data = (char*)data + currentBlockSize;
length -= currentBlockSize;
if ((start!=buffer) && (end==bufferEnd))
end = buffer;
if (len) { // short circuit
::memcpy(end, data, len);
- (char*)data += len;
- (char*)end += len;
+ data = (char*)data + len;
+ end = (char*)end + len;
length -= len;
if ((start!=buffer) && (end==bufferEnd))