From 5f6a2365503506269d15c7b777a97eec37b68339 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 1 Jul 2014 20:04:58 +0400 Subject: [PATCH] Compilation fix 2 --- Utilities/SQueue.h | 6 ++++-- rpcs3/Emu/SysCalls/Modules/cellVdec.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellVdec.h | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Utilities/SQueue.h b/Utilities/SQueue.h index 52b68979f0..9aa7e58356 100644 --- a/Utilities/SQueue.h +++ b/Utilities/SQueue.h @@ -125,12 +125,14 @@ public: return m_data[(m_pos + pos) % SQSize]; } - T& PeekIfExist(T& def, u32 pos = 0) + T& PeekIfExist(u32 pos = 0) { + static T def_value; + std::lock_guard lock(m_mutex); if (m_count <= pos) { - return def; + return def_value; } else { diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index c1551e842e..d76d846c4d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -306,7 +306,7 @@ u32 vdecOpen(VideoDecoder* data) while (true) { - if (Emu.IsStopped() || vdec.job.PeekIfExist(VdecTask()).type == vdecClose) + if (Emu.IsStopped() || vdec.job.PeekIfExist().type == vdecClose) { vdec.is_finished = true; LOG_WARNING(HLE, "vdecDecodeAu: aborted"); diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.h b/rpcs3/Emu/SysCalls/Modules/cellVdec.h index 7f323c94b7..5b6a5633d2 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.h +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.h @@ -647,6 +647,7 @@ struct CellVdecMpeg2Info enum VdecJobType : u32 { + vdecInvalid, vdecStartSeq, vdecEndSeq, vdecDecodeAu, @@ -675,6 +676,7 @@ struct VdecTask } VdecTask() + : type(vdecInvalid) { } };