diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.cpp b/rpcs3/Emu/Cell/Modules/cellVdec.cpp index 631fa8647e..05324d0198 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVdec.cpp @@ -14,7 +14,6 @@ extern "C" #include "cellVdec.h" #include -#include #include #include @@ -77,7 +76,6 @@ struct vdec_thread : ppu_thread std::mutex mutex; std::queue out; - std::queue user_data; // TODO vdec_thread(s32 type, u32 profile, u32 addr, u32 size, vm::ptr func, u32 arg) : ppu_thread("HLE Video Decoder") @@ -338,6 +336,12 @@ struct vdec_thread : ppu_thread } cb_func(*this, id, vcmd == vdec_cmd::decode ? CELL_VDEC_MSG_TYPE_AUDONE : CELL_VDEC_MSG_TYPE_SEQDONE, CELL_OK, cb_arg); + + while (std::lock_guard{mutex}, out.size() > 60) + { + thread_ctrl::wait(); + } + break; } @@ -525,6 +529,11 @@ s32 cellVdecGetPicture(u32 handle, vm::cptr format, vm::ptrout.front()); vdec->out.pop(); + + if (vdec->out.size() <= 60) + { + vdec->notify(); + } } vdec->notify();