mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 07:03:33 +02:00
Fix buffer queue.
This commit is contained in:
@@ -86,13 +86,20 @@ struct BufferQueue {
|
||||
if (buf) {
|
||||
if (start + bytesgot <= bufQueueSize) {
|
||||
memcpy(buf, bufQueue + start, bytesgot);
|
||||
start += bytesgot;
|
||||
} else {
|
||||
int firstSize = bufQueueSize - start;
|
||||
memcpy(buf, bufQueue + start, firstSize);
|
||||
memcpy(buf + firstSize, bufQueue, bytesgot - firstSize);
|
||||
start = bytesgot - firstSize;
|
||||
}
|
||||
} else {
|
||||
int firstSize = bufQueueSize - start;
|
||||
if (start + bytesgot <= bufQueueSize)
|
||||
start += bytesgot;
|
||||
else
|
||||
start = bytesgot - firstSize;
|
||||
}
|
||||
start = (start + bytesgot) % bufQueueSize;
|
||||
return bytesgot;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user