Merge pull request #23030 from hrydgard/empty-frame-handling

sceVideocodec: Fail decoding an empty access unit, as the PSP does
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2026-11-10 18:49:53 +01:00
commit efdf633d8a
4 files changed
+10 -2

No files matched your search

+7
View File
@@ -759,6 +759,13 @@ static int sceVideocodecDecode(u32 ctxAddr, int type) {
// is about to read. Nor is a picture announced until the buffers holding it have been
// published: saying "one image decoded" and then failing to allocate would have mpeg.prx
// convert from whatever the descriptor pointed at last.
if (auSize <= 0) {
// An empty access unit is an error, and the stream carries on normally after it
// (pspautotests video/mpeg/decoderepeat). sceMpegAvcDecode passes one when called again
// on a unit it already decoded, which some movie players do until a picture comes back.
// The error is what ends their loop.
return hleLogDebug(Log::ME, SCE_MPEG_ERROR_AVC_DECODE_FATAL, "type 0, no access unit");
}
int pictures = 0;
if (au && auBytes > 0) {
if (vctx.decoder->DecodePictures(au, auBytes) < 0) {
+1 -1
View File
@@ -89,7 +89,7 @@ static inline void DelaySlotJumpTo(MIPSState *mips, u32 where) {
if (!InJumpDelaySlot(mips)) {
return;
}
if (!mips->space->IsValidAddress(where) || (where & 3) != 0) {
if (!mips->space->IsValid4AlignedAddress(where)) {
Core_ExecException(where, PC, ExecExceptionType::JUMP);
}
mips->nextPC = where;
+1
View File
@@ -795,6 +795,7 @@ tests_next = [
"video/mp4/avchold", # needs Sony's mp4 and mpeg modules: --disable-hle=0x110, see docs/pspautotests.md
"video/mpeg/basic",
"video/mpeg/decodeend", # needs Sony's mpeg module, as avchold
"video/mpeg/decoderepeat", # needs Sony's mpeg module, as avchold
"video/mpeg/deletetiming",
"video/pmf/pmf",
"video/pmf_simple/pmf_simple",