diff --git a/rpcs3/Emu/Cell/Modules/cellAdec.h b/rpcs3/Emu/Cell/Modules/cellAdec.h index 8313b45b8d..ffa0cde002 100644 --- a/rpcs3/Emu/Cell/Modules/cellAdec.h +++ b/rpcs3/Emu/Cell/Modules/cellAdec.h @@ -325,7 +325,7 @@ struct AdecCb vm::bptr cbArg; }; -typedef AdecCb CellAdecCb; +using CellAdecCb = AdecCb; // AU Info struct CellAdecAuInfo @@ -409,7 +409,7 @@ using CellAdecCoreOpClose = error_code(vm::ptr coreHandle); using CellAdecCoreOpStartSeq = error_code(vm::ptr coreHandle, vm::cptr param); using CellAdecCoreOpEndSeq = error_code(vm::ptr coreHandle); using CellAdecCoreOpDecodeAu = error_code(vm::ptr coreHandle, s32 pcmHandle, vm::cptr auInfo); -using CellAdecCoreOpGetVersion = void(vm::ptr> version); +using CellAdecCoreOpGetVersion = void(vm::ptr> version); using CellAdecCoreOpRealign = error_code(vm::ptr coreHandle, vm::ptr outBuffer, vm::cptr pcmStartAddr); using CellAdecCoreOpReleasePcm = error_code(vm::ptr coreHandle, s32 pcmHandle, vm::cptr outBuffer); using CellAdecCoreOpGetPcmHandleNum = s32(); diff --git a/rpcs3/Emu/Cell/Modules/cellAtracXdec.cpp b/rpcs3/Emu/Cell/Modules/cellAtracXdec.cpp index 18bc943629..36da7560d0 100644 --- a/rpcs3/Emu/Cell/Modules/cellAtracXdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellAtracXdec.cpp @@ -414,7 +414,7 @@ void AtracXdecContext::exec(ppu_thread& ppu) if (int err = avcodec_send_packet(decoder.ctx, decoder.packet); err) { // These errors should never occur - if (err == AVERROR(EAGAIN) || err == AVERROR_EOF || err == AVERROR(EINVAL) || err == AVERROR(ENOMEM)) + if (err == AVERROR(EAGAIN) || err == averror_eof || err == AVERROR(EINVAL) || err == AVERROR(ENOMEM)) { fmt::throw_exception("avcodec_send_packet() failed (err=0x%x='%s')", err, utils::av_error_to_string(err)); } @@ -425,7 +425,7 @@ void AtracXdecContext::exec(ppu_thread& ppu) av_frame_unref(decoder.frame); } - else if (err = avcodec_receive_frame(decoder.ctx, decoder.frame)) + else if ((err = avcodec_receive_frame(decoder.ctx, decoder.frame))) { fmt::throw_exception("avcodec_receive_frame() failed (err=0x%x='%s')", err, utils::av_error_to_string(err)); } @@ -433,7 +433,7 @@ void AtracXdecContext::exec(ppu_thread& ppu) decoded_samples_num = decoder.frame->nb_samples; ensure(decoded_samples_num == 0u || decoded_samples_num == ATXDEC_SAMPLES_PER_FRAME); - // The first frame after a starting a new sequence or after an error is replaced with silence + // The first frame after starting a new sequence or after an error is replaced with silence if (skip_next_frame && error == CELL_OK) { skip_next_frame = false; @@ -781,16 +781,13 @@ error_code _CellAdecCoreOpDecodeAu_atracx(ppu_thread& ppu, vm::ptrsend_command(ppu, pcmHandle, *auInfo); } -void _CellAdecCoreOpGetVersion_atracx(vm::ptr version) +void _CellAdecCoreOpGetVersion_atracx(vm::ptr> version) { cellAtracXdec.notice("_CellAdecCoreOpGetVersion_atracx(version=*0x%x)", version); ensure(!!version); // Not checked on LLE - version[0] = 0x01; - version[1] = 0x02; - version[2] = 0x00; - version[3] = 0x00; + *version = 0x01020000; } error_code _CellAdecCoreOpRealign_atracx(vm::ptr handle, vm::ptr outBuffer, vm::cptr pcmStartAddr) diff --git a/rpcs3/Emu/Cell/Modules/cellAtracXdec.h b/rpcs3/Emu/Cell/Modules/cellAtracXdec.h index b3ea7cb996..fc96b6ef86 100644 --- a/rpcs3/Emu/Cell/Modules/cellAtracXdec.h +++ b/rpcs3/Emu/Cell/Modules/cellAtracXdec.h @@ -12,6 +12,8 @@ extern "C" { #include "libavcodec/avcodec.h" } + +constexpr int averror_eof = AVERROR_EOF; // Workaround for old-style-cast error #ifdef _MSC_VER #pragma warning(pop) #else