UI: Change output blocking bool to integer ref counter

This commit is contained in:
jp9000 2017-05-15 14:15:25 -07:00
parent 0697e37b26
commit 4ff7ac0bfa
2 changed files with 10 additions and 5 deletions

View file

@ -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;

View file

@ -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);