scePsmfPlayerGetVideoData() keeps going at end.

Even if the video has ended, this happily returns the last frame (with the
same pts value) over and over.  Audio or no audio.

It only returns no data when it's called too early.
This commit is contained in:
Unknown W. Brackets 2014-05-22 22:19:10 -07:00
parent e79d700bf0
commit a2031cdc62

View File

@ -1493,22 +1493,20 @@ int scePsmfPlayerGetVideoData(u32 psmfPlayer, u32 videoDataAddr)
}
}
if (!doVideoStep || psmfplayer->mediaengine->stepVideo(videoPixelMode)) {
int displaybufSize = psmfplayer->mediaengine->writeVideoImage(videoData->displaybuf, videoData->frameWidth, videoPixelMode);
gpu->InvalidateCache(videoData->displaybuf, displaybufSize, GPU_INVALIDATE_SAFE);
if (doVideoStep) {
psmfplayer->mediaengine->stepVideo(videoPixelMode);
}
// Always write the video frame, even after the video has ended.
int displaybufSize = psmfplayer->mediaengine->writeVideoImage(videoData->displaybuf, videoData->frameWidth, videoPixelMode);
gpu->InvalidateCache(videoData->displaybuf, displaybufSize, GPU_INVALIDATE_SAFE);
__PsmfUpdatePts(psmfplayer, videoData);
}
_PsmfPlayerFillRingbuffer(psmfplayer);
int ret = psmfplayer->mediaengine->IsVideoEnd() ? (int)ERROR_PSMFPLAYER_NO_MORE_DATA : 0;
DEBUG_LOG(ME, "%08x=scePsmfPlayerGetVideoData(%08x, %08x)", ret, psmfPlayer, videoDataAddr);
if (ret != 0) {
return ret;
}
return hleDelayResult(ret, "psmfPlayer video decode", 3000);
DEBUG_LOG(ME, "%08x=scePsmfPlayerGetVideoData(%08x, %08x)", 0, psmfPlayer, videoDataAddr);
return hleDelayResult(0, "psmfPlayer video decode", 3000);
}
int scePsmfPlayerGetAudioData(u32 psmfPlayer, u32 audioDataAddr)