Explorar el Código

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 hace 8 años
padre
commit
c422d84d6e
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  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;
 		}
 	}