UI: Check if recording is paused when trying to pause

Adds a safety check to the pause-functions, double-checking that they
won't be called whether it is already in the desired state
master
gxalpha 2021-06-18 16:22:04 +02:00 committed by Jim
parent 0fd153f9e1
commit 7526bf76ff
1 changed files with 4 additions and 2 deletions

View File

@ -8965,7 +8965,8 @@ void OBSBasic::UpdatePatronJson(const QString &text, const QString &error)
void OBSBasic::PauseRecording() void OBSBasic::PauseRecording()
{ {
if (!pause || !outputHandler || !outputHandler->fileOutput) if (!pause || !outputHandler || !outputHandler->fileOutput ||
os_atomic_load_bool(&recording_paused))
return; return;
obs_output_t *output = outputHandler->fileOutput; obs_output_t *output = outputHandler->fileOutput;
@ -9004,7 +9005,8 @@ void OBSBasic::PauseRecording()
void OBSBasic::UnpauseRecording() void OBSBasic::UnpauseRecording()
{ {
if (!pause || !outputHandler || !outputHandler->fileOutput) if (!pause || !outputHandler || !outputHandler->fileOutput ||
!os_atomic_load_bool(&recording_paused))
return; return;
obs_output_t *output = outputHandler->fileOutput; obs_output_t *output = outputHandler->fileOutput;