From 6a32ceaab536480de07a56cc462f5ec2aef8914e Mon Sep 17 00:00:00 2001 From: Eladash Date: Tue, 4 Feb 2020 15:15:18 +0200 Subject: [PATCH] cellVdecQueryAttrEx: Add workaround for codec specific info --- rpcs3/Emu/Cell/Modules/cellVdec.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.cpp b/rpcs3/Emu/Cell/Modules/cellVdec.cpp index c748ab494a..09d1accf64 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVdec.cpp @@ -505,7 +505,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 attr->decoderVerLower = decoderVerLower; attr->decoderVerUpper = 0x4840010; - attr->memSize = verify(HERE, memSize); + attr->memSize = !spec_addr ? verify(HERE, memSize) : 4 * 1024 * 1024; attr->cmdDepth = 4; return CELL_OK; } @@ -548,8 +548,15 @@ static error_code vdecOpen(ppu_thread& ppu, T type, U res, vm::cptr return CELL_VDEC_ERROR_ARG; } + u32 spec_addr = 0; + + if constexpr (std::is_same_v, CellVdecTypeEx>) + { + spec_addr = type->codecSpecificInfo_addr; + } + if (CellVdecAttr attr{}; - vdecQueryAttr(type->codecType, type->profileLevel, 0, &attr) != CELL_OK || + vdecQueryAttr(type->codecType, type->profileLevel, spec_addr, &attr) != CELL_OK || attr.memSize > res->memSize) { return CELL_VDEC_ERROR_ARG;