Skip to content

Commit f4d5d9d

Browse files
committed
SLOBS frontend: soak first mac-virtualcam start event
* Commit c85d4fa renames virtualcam events into start & stop. Problem is OBS frontend will always assume the user has started the virtualcam now. Unfortunately now there is a modal popup that is displayed if you attempt to close OBS because it thinks you started virtualcam (when you didnt). This change at least gets rid of the modal dialog when you run SLOBS backend
1 parent bfbdb08 commit f4d5d9d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

frontend/utility/BasicOutputHandler.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,13 @@ void OBSReplayBufferSaved(void *data, calldata_t * /* params */)
144144
static void OBSStartVirtualCam(void *data, calldata_t * /* params */)
145145
{
146146
BasicOutputHandler *output = static_cast<BasicOutputHandler *>(data);
147-
147+
#ifdef __APPLE__
148+
// Streamlabs - Suppress first "start" signal from mac-virtualcam which is spun up automatically by OBS. SLD doesnt work this way
149+
if (!output->hasReceivedStartSignal) {
150+
output->hasReceivedStartSignal = true;
151+
return;
152+
}
153+
#endif
148154
output->virtualCamActive = true;
149155
os_atomic_set_bool(&virtualcam_active, true);
150156
QMetaObject::invokeMethod(output->main, "OnVirtualCamStart");

frontend/utility/BasicOutputHandler.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ struct BasicOutputHandler {
2525
bool delayActive = false;
2626
bool replayBufferActive = false;
2727
bool virtualCamActive = false;
28+
bool hasReceivedStartSignal = false; // Streamlabs - ignore first signal
2829
OBSBasic *main;
2930

3031
std::unique_ptr<MultitrackVideoOutput> multitrackVideo;

0 commit comments

Comments
 (0)