This patch is intended to fix the audioringbuffer Read() method to prevent scratches.
int count2 = Math.Min(requested - count1, writePointer);
if (count2 > 0)
{
if (buffer != IntPtr.Zero)
{
IntPtr ptr = new IntPtr(
_Is32bit ? buffer.ToInt32() : buffer.ToInt64() + (count1*BassConstants.FloatBytes));
Marshal.Copy(_buffer, 0, ptr, count2);
}
readPointer = count2;
}
read = count1 + count2;
int count2 = Math.Min(requested - count1, writePointer);
if (count2 > 0)
{
if (buffer != IntPtr.Zero)
{
IntPtr ptr = new IntPtr(
(_Is32bit ? buffer.ToInt32() : buffer.ToInt64()) + (count1*BassConstants.FloatBytes));
Marshal.Copy(_buffer, 0, ptr, count2);
}
readPointer = count2;
}
else
count2 = 0;
read = count1 + count2;