mirror of
https://github.com/OpenEmu/PPSSPP-Core.git
synced 2025-11-01 11:05:49 +00:00
Fix audio related crash.
In some cases, __DisplayGetFPS can return wildly negative values and cause a crash based on how we compute samples. Known occurrence in Power Stone Collection while loading Power Stone.
This commit is contained in:
@@ -171,6 +171,8 @@
|
||||
|
||||
float vps, fps;
|
||||
__DisplayGetFPS(&vps, &_frameInterval, &fps);
|
||||
|
||||
if(_frameInterval <= 0) _frameInterval = 60;
|
||||
|
||||
int samplesWritten = NativeMix((short *)_soundBuffer, SAMPLERATE / _frameInterval);
|
||||
[[self ringBufferAtIndex:0] write:_soundBuffer maxLength:sizeof(uint16_t) * samplesWritten * 2];
|
||||
|
||||
Reference in New Issue
Block a user