frontend-tools: Fix multiple signal-slot connections on Output Timer
When running an Output Timer multiple times, multiple signal-slot connections would be made with the corresponding output stop event functions. This would cause later Output Timers to terminate unexpectedly early, due to the stop functions having been called repeatedly on previous Output Timer runs while outputs were stopping. There may still be an underlying bug with calling stop on outputs repeatedly, but this change at least ensures that Output Timers only call their stop functions once.
This commit is contained in:
parent
cfd8d4c993
commit
93f5b45be8
1 changed files with 9 additions and 12 deletions
|
|
@ -32,6 +32,15 @@ OutputTimer::OutputTimer(QWidget *parent)
|
|||
|
||||
recordingTimer = new QTimer(this);
|
||||
recordingTimerDisplay = new QTimer(this);
|
||||
|
||||
QObject::connect(streamingTimer, &QTimer::timeout, this,
|
||||
&OutputTimer::EventStopStreaming);
|
||||
QObject::connect(streamingTimerDisplay, &QTimer::timeout, this,
|
||||
&OutputTimer::UpdateStreamTimerDisplay);
|
||||
QObject::connect(recordingTimer, &QTimer::timeout, this,
|
||||
&OutputTimer::EventStopRecording);
|
||||
QObject::connect(recordingTimerDisplay, &QTimer::timeout, this,
|
||||
&OutputTimer::UpdateRecordTimerDisplay);
|
||||
}
|
||||
|
||||
void OutputTimer::closeEvent(QCloseEvent *)
|
||||
|
|
@ -86,12 +95,6 @@ void OutputTimer::StreamTimerStart()
|
|||
streamingTimer->setInterval(total);
|
||||
streamingTimer->setSingleShot(true);
|
||||
|
||||
QObject::connect(streamingTimer, &QTimer::timeout, this,
|
||||
&OutputTimer::EventStopStreaming);
|
||||
|
||||
QObject::connect(streamingTimerDisplay, &QTimer::timeout, this,
|
||||
&OutputTimer::UpdateStreamTimerDisplay);
|
||||
|
||||
streamingTimer->start();
|
||||
streamingTimerDisplay->start(1000);
|
||||
ui->outputTimerStream->setText(obs_module_text("Stop"));
|
||||
|
|
@ -120,12 +123,6 @@ void OutputTimer::RecordTimerStart()
|
|||
recordingTimer->setInterval(total);
|
||||
recordingTimer->setSingleShot(true);
|
||||
|
||||
QObject::connect(recordingTimer, &QTimer::timeout, this,
|
||||
&OutputTimer::EventStopRecording);
|
||||
|
||||
QObject::connect(recordingTimerDisplay, &QTimer::timeout, this,
|
||||
&OutputTimer::UpdateRecordTimerDisplay);
|
||||
|
||||
recordingTimer->start();
|
||||
recordingTimerDisplay->start(1000);
|
||||
ui->outputTimerRecord->setText(obs_module_text("Stop"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue