Skip to content

Commit

Permalink
cellVdec Test [No Merge]
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Feb 4, 2020
1 parent 149577a commit aec71b6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions rpcs3/Emu/Cell/Modules/cellVdec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -548,8 +548,15 @@ static error_code vdecOpen(ppu_thread& ppu, T type, U res, vm::cptr<CellVdecCb>
return CELL_VDEC_ERROR_ARG;
}

u32 spec_addr = 0;

if constexpr (std::is_same_v<std::decay_t<typename T::type>, 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;
Expand Down

0 comments on commit aec71b6

Please sign in to comment.