Browse Source

frontend-tools: Fix output timer stopping recording on unpause

If the "Pause timer when recording is paused" option in the Output Timer
settings was enabled, even if an Output Timer was not being used, a
recording may stop when attempting to unpause it. This was due to the
check in the UnpauseRecordingTimer function being too loose and only
checking for if the recording timer was not active. Let's initialize the
recordingTimeLeft variable to -1 and check that it's greater than 0
before attempting to restart a recording timer.
Ryan Foster 1 year ago
parent
commit
589495a952

+ 1 - 1
UI/frontend-plugins/frontend-tools/output-timer.cpp

@@ -218,7 +218,7 @@ void OutputTimer::UnpauseRecordingTimer()
 	if (!ui->pauseRecordTimer->isChecked())
 		return;
 
-	if (!recordingTimer->isActive())
+	if (recordingTimeLeft > 0 && !recordingTimer->isActive())
 		recordingTimer->start(recordingTimeLeft);
 }
 

+ 1 - 1
UI/frontend-plugins/frontend-tools/output-timer.hpp

@@ -40,5 +40,5 @@ private:
 	QTimer *streamingTimerDisplay;
 	QTimer *recordingTimerDisplay;
 
-	int recordingTimeLeft;
+	int recordingTimeLeft = -1;
 };