mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-12-14 00:49:49 +00:00
Don't completely fill the psmf ringbuffer at once.
It takes more time (slowing the start of the video), and gets us closer to overflowing buffers and stuff.
This commit is contained in:
parent
0de71f27cb
commit
f095ac656b
@ -861,16 +861,21 @@ int _PsmfPlayerFillRingbuffer(PsmfPlayer *psmfplayer) {
|
||||
if (!psmfplayer->filehandle || !psmfplayer->tempbuf)
|
||||
return -1;
|
||||
u8* buf = psmfplayer->tempbuf;
|
||||
u32 tempbufSize = sizeof(psmfplayer->tempbuf);
|
||||
int tempbufSize = (int)sizeof(psmfplayer->tempbuf);
|
||||
int size;
|
||||
// Let's not burn a bunch of time adding data all at once.
|
||||
int addMax = std::max(2048 * 100, tempbufSize);
|
||||
do {
|
||||
size = std::min(psmfplayer->mediaengine->getRemainSize(), (int)tempbufSize);
|
||||
size = std::min(psmfplayer->mediaengine->getRemainSize(), tempbufSize);
|
||||
size = std::min(psmfplayer->streamSize - psmfplayer->readSize, size);
|
||||
if (size <= 0)
|
||||
break;
|
||||
size = (int)pspFileSystem.ReadFile(psmfplayer->filehandle, buf, size);
|
||||
psmfplayer->readSize += size;
|
||||
psmfplayer->mediaengine->addStreamData(buf, size);
|
||||
addMax -= size;
|
||||
if (addMax <= 0)
|
||||
break;
|
||||
} while (size > 0);
|
||||
if (psmfplayer->readSize >= psmfplayer->streamSize && videoLoopStatus == PSMF_PLAYER_CONFIG_LOOP) {
|
||||
// start looping
|
||||
|
Loading…
Reference in New Issue
Block a user