Forráskód Böngészése

win-dshow: Fix issue with activating when not set to

When the windows video device source source is set to only activate when
showing, it would still activate on first startup of the program even if
it was in another scene and not showing anywhere to the user.  This
fixes that issue.
jp9000 8 éve
szülő
commit
c422d84d6e
1 módosított fájl, 7 hozzáadás és 1 törlés
  1. 7 1
      plugins/win-dshow/win-dshow.cpp

+ 7 - 1
plugins/win-dshow/win-dshow.cpp

@@ -208,8 +208,14 @@ struct DShowInput {
 		if (!thread)
 			throw "Failed to create thread";
 
+		deactivateWhenNotShowing =
+			obs_data_get_bool(settings, DEACTIVATE_WNS);
+
 		if (obs_data_get_bool(settings, "active")) {
-			QueueAction(Action::Activate);
+			bool showing = obs_source_showing(source);
+			if (!deactivateWhenNotShowing || showing)
+				QueueAction(Action::Activate);
+
 			active = true;
 		}
 	}