mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 10:42:36 +01:00
cellVdecDecodeAu: add codec type check
This commit is contained in:
parent
fb3752a8ef
commit
ee3a302cf2
@ -1023,17 +1023,17 @@ error_code cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVd
|
||||
}
|
||||
}
|
||||
|
||||
if (mode < 0 || mode > CELL_VDEC_DEC_MODE_PB_SKIP)
|
||||
if (mode < 0 || mode > (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP))
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, fmt::format("mode=%d", +mode) };
|
||||
}
|
||||
|
||||
// TODO:
|
||||
//if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && something != 3) ||
|
||||
// (mode == CELL_VDEC_DEC_MODE_PB_SKIP && something != 1))
|
||||
//{
|
||||
// return CELL_VDEC_ERROR_ARG;
|
||||
//}
|
||||
// TODO: what does the 3 stand for ?
|
||||
if ((mode == CELL_VDEC_CODEC_TYPE_MAX && vdec->type != 3) ||
|
||||
(mode == CELL_VDEC_DEC_MODE_PB_SKIP && vdec->type != CELL_VDEC_CODEC_TYPE_AVC))
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, fmt::format("mode=%d, type=%d", +mode, vdec->type) };
|
||||
}
|
||||
|
||||
if (!vdec->au_count.try_inc(4))
|
||||
{
|
||||
|
@ -17,6 +17,7 @@ enum CellVdecCodecType : s32
|
||||
CELL_VDEC_CODEC_TYPE_MPEG2 = 0,
|
||||
CELL_VDEC_CODEC_TYPE_AVC = 1,
|
||||
CELL_VDEC_CODEC_TYPE_DIVX = 5,
|
||||
CELL_VDEC_CODEC_TYPE_MAX
|
||||
};
|
||||
|
||||
// Callback Messages
|
||||
|
Loading…
Reference in New Issue
Block a user