UI: Change output blocking bool to integer ref counter
parent
0697e37b26
commit
4ff7ac0bfa
|
@ -3958,7 +3958,7 @@ void OBSBasic::StartStreaming()
|
|||
{
|
||||
if (outputHandler->StreamingActive())
|
||||
return;
|
||||
if (!enableOutputs)
|
||||
if (disableOutputsRef)
|
||||
return;
|
||||
|
||||
if (api)
|
||||
|
@ -4250,7 +4250,7 @@ void OBSBasic::StartRecording()
|
|||
{
|
||||
if (outputHandler->RecordingActive())
|
||||
return;
|
||||
if (!enableOutputs)
|
||||
if (disableOutputsRef)
|
||||
return;
|
||||
|
||||
if (api)
|
||||
|
@ -4352,7 +4352,7 @@ void OBSBasic::StartReplayBuffer()
|
|||
return;
|
||||
if (outputHandler->ReplayBufferActive())
|
||||
return;
|
||||
if (!enableOutputs)
|
||||
if (disableOutputsRef)
|
||||
return;
|
||||
|
||||
obs_output_t *output = outputHandler->replayBuffer;
|
||||
|
|
|
@ -318,7 +318,7 @@ private:
|
|||
int programCX = 0, programCY = 0;
|
||||
float programScale = 0.0f;
|
||||
|
||||
bool enableOutputs = true;
|
||||
int disableOutputsRef = 0;
|
||||
|
||||
inline bool IsPreviewProgramMode() const
|
||||
{
|
||||
|
@ -501,7 +501,12 @@ public:
|
|||
|
||||
inline void EnableOutputs(bool enable)
|
||||
{
|
||||
enableOutputs = enable;
|
||||
if (enable) {
|
||||
if (--disableOutputsRef < 0)
|
||||
disableOutputsRef = 0;
|
||||
} else {
|
||||
disableOutputsRef++;
|
||||
}
|
||||
}
|
||||
|
||||
void ReorderSceneItem(obs_sceneitem_t *item, size_t idx);
|
||||
|
|
Loading…
Reference in New Issue