mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-27 12:18:35 +01:00
Fix buffer queue.
This commit is contained in:
1 parent
108d592461
commit
dc0d221900
1 file changed
+8
-1
@@ -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