mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Try to fix 'avail' test
This commit is contained in:
@@ -1376,7 +1376,12 @@ static int sceMpegRingbufferAvailableSize(u32 ringbufferAddr) {
|
||||
}
|
||||
|
||||
ctx->mpegRingbufferAddr = ringbufferAddr;
|
||||
if (ctx->mediaengine) {
|
||||
|
||||
// PPSSPP doesn't have a fully asynchronous Media Engine thread to constantly drain the buffer.
|
||||
// Games like Ridge Racer 2 rely on this function to implicitly update the available size.
|
||||
// However, we must NOT overwrite packetsAvail if the stream hasn't been initialized/analyzed yet.
|
||||
// This protects manual struct modifications (like in the 'avail' test) prior to stream playback.
|
||||
if (ctx->mediaengine && ctx->isAnalyzed) {
|
||||
ringbuffer->packetsAvail = ringbuffer->packets - ctx->mediaengine->getRemainSize() / 2048;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user