Movie: Replace a blocking RunOnCPUThread call with a CPUThreadGuard.

This commit is contained in:
Jordan Woyak 2025-11-16 17:14:09 -06:00
parent 56532c850f
commit 6380ad6abb

View File

@ -493,7 +493,10 @@ bool MovieManager::BeginRecordingInput(const ControllerTypeArray& controllers,
(controllers == ControllerTypeArray{} && wiimotes == WiimoteEnabledArray{})) (controllers == ControllerTypeArray{} && wiimotes == WiimoteEnabledArray{}))
return false; return false;
const auto start_recording = [this, controllers, wiimotes] { Core::DisplayMessage("Starting movie recording", 2000);
Core::CPUThreadGuard cpu_thread_guard{m_system};
m_controllers = controllers; m_controllers = controllers;
m_wiimotes = wiimotes; m_wiimotes = wiimotes;
m_current_frame = m_total_frames = 0; m_current_frame = m_total_frames = 0;
@ -563,10 +566,7 @@ bool MovieManager::BeginRecordingInput(const ControllerTypeArray& controllers,
if (Core::IsRunning(m_system)) if (Core::IsRunning(m_system))
Core::UpdateWantDeterminism(m_system); Core::UpdateWantDeterminism(m_system);
};
Core::RunOnCPUThread(m_system, start_recording, true);
Core::DisplayMessage("Starting movie recording", 2000);
return true; return true;
} }