cellVdec: Fix AU decode count on callback (#13342)

This commit is contained in:
Elad Ashkenazi 2023-02-05 14:02:51 +02:00 committed by GitHub
parent 1cf8aacc11
commit 8652b7d358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,7 +205,7 @@ struct vdec_context final
std::deque<vdec_frame> out_queue; std::deque<vdec_frame> out_queue;
const u32 out_max = 60; const u32 out_max = 60;
atomic_t<u32> au_count{0}; atomic_t<s32> au_count{0};
lf_queue<vdec_cmd> in_cmd; lf_queue<vdec_cmd> in_cmd;
@ -540,14 +540,11 @@ struct vdec_context final
{ {
// Send AUDONE even if the current sequence was reset and a new sequence was started. // Send AUDONE even if the current sequence was reset and a new sequence was started.
cellVdec.trace("Sending CELL_VDEC_MSG_TYPE_AUDONE (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id); cellVdec.trace("Sending CELL_VDEC_MSG_TYPE_AUDONE (handle=0x%x, seq_id=%d, cmd_id=%d)", handle, cmd->seq_id, cmd->id);
ensure(au_count.try_dec(0));
cb_func(ppu, vid, CELL_VDEC_MSG_TYPE_AUDONE, CELL_OK, cb_arg); cb_func(ppu, vid, CELL_VDEC_MSG_TYPE_AUDONE, CELL_OK, cb_arg);
lv2_obj::sleep(ppu); lv2_obj::sleep(ppu);
if (au_count > 0)
{
--au_count;
}
while (!decoded_frames.empty() && seq_id == cmd->seq_id) while (!decoded_frames.empty() && seq_id == cmd->seq_id)
{ {
// Wait until there is free space in the image queue. // Wait until there is free space in the image queue.