AV decoding minor cleanup

This commit is contained in:
Nekotekina 2014-10-18 21:00:21 +04:00
parent 318d06efda
commit 81474be103
4 changed files with 82 additions and 135 deletions

View file

@ -78,30 +78,13 @@ public:
}
}
u32 GetCount()
{
std::lock_guard<std::mutex> lock(m_mutex);
return m_count;
}
u32 GetCountUnsafe()
{
return m_count;
}
bool IsEmpty()
{
std::lock_guard<std::mutex> lock(m_mutex);
return !m_count;
}
void Clear()
{
std::lock_guard<std::mutex> lock(m_mutex);
m_count = 0;
}
T& Peek(const volatile bool* do_exit, u32 pos = 0)
bool Peek(T& data, const volatile bool* do_exit, u32 pos = 0)
{
while (true)
{
@ -109,7 +92,7 @@ public:
{
if (Emu.IsStopped() || do_exit && *do_exit)
{
break;
return false;
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
@ -124,6 +107,7 @@ public:
}
}
}
return m_data[(m_pos + pos) % SQSize];
data = m_data[(m_pos + pos) % SQSize];
return true;
}
};