mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-07 03:40:07 +00:00
recording: use scoped_lock
This commit is contained in:
parent
bebac4773a
commit
4520f7646f
@ -176,8 +176,7 @@ public:
|
|||||||
{
|
{
|
||||||
cellRec.notice("Stopping video sink. flush=%d", flush);
|
cellRec.notice("Stopping video sink. flush=%d", flush);
|
||||||
|
|
||||||
std::lock_guard lock_video(m_video_mtx);
|
std::scoped_lock lock(m_video_mtx, m_audio_mtx);
|
||||||
std::lock_guard lock_audio(m_audio_mtx);
|
|
||||||
m_flush = flush;
|
m_flush = flush;
|
||||||
m_paused = false;
|
m_paused = false;
|
||||||
m_frames_to_encode.clear();
|
m_frames_to_encode.clear();
|
||||||
@ -189,8 +188,7 @@ public:
|
|||||||
{
|
{
|
||||||
cellRec.notice("Pausing video sink. flush=%d", flush);
|
cellRec.notice("Pausing video sink. flush=%d", flush);
|
||||||
|
|
||||||
std::lock_guard lock_video(m_video_mtx);
|
std::scoped_lock lock(m_video_mtx, m_audio_mtx);
|
||||||
std::lock_guard lock_audio(m_audio_mtx);
|
|
||||||
m_flush = flush;
|
m_flush = flush;
|
||||||
m_paused = true;
|
m_paused = true;
|
||||||
}
|
}
|
||||||
@ -199,8 +197,7 @@ public:
|
|||||||
{
|
{
|
||||||
cellRec.notice("Resuming video sink");
|
cellRec.notice("Resuming video sink");
|
||||||
|
|
||||||
std::lock_guard lock_video(m_video_mtx);
|
std::scoped_lock lock(m_video_mtx, m_audio_mtx);
|
||||||
std::lock_guard lock_audio(m_audio_mtx);
|
|
||||||
m_flush = false;
|
m_flush = false;
|
||||||
m_paused = false;
|
m_paused = false;
|
||||||
}
|
}
|
||||||
|
@ -781,8 +781,7 @@ namespace utils
|
|||||||
m_thread.reset();
|
m_thread.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::lock_guard lock_video(m_video_mtx);
|
std::scoped_lock lock(m_video_mtx, m_audio_mtx);
|
||||||
std::lock_guard lock_audio(m_audio_mtx);
|
|
||||||
m_frames_to_encode.clear();
|
m_frames_to_encode.clear();
|
||||||
m_samples_to_encode.clear();
|
m_samples_to_encode.clear();
|
||||||
has_error = false;
|
has_error = false;
|
||||||
|
@ -45,8 +45,7 @@ namespace utils
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::lock_guard lock_video(m_video_mutex);
|
std::scoped_lock lock(m_video_mutex, m_audio_mutex);
|
||||||
std::lock_guard lock_audio(m_audio_mutex);
|
|
||||||
|
|
||||||
if (m_video_sink)
|
if (m_video_sink)
|
||||||
{
|
{
|
||||||
@ -80,9 +79,7 @@ namespace utils
|
|||||||
|
|
||||||
void video_provider::set_pause_time_us(usz pause_time_us)
|
void video_provider::set_pause_time_us(usz pause_time_us)
|
||||||
{
|
{
|
||||||
std::lock_guard lock_video(m_video_mutex);
|
std::scoped_lock lock(m_video_mutex, m_audio_mutex);
|
||||||
std::lock_guard lock_audio(m_audio_mutex);
|
|
||||||
|
|
||||||
m_pause_time_us = pause_time_us;
|
m_pause_time_us = pause_time_us;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user