Răsfoiți Sursa

UI: Fix logging of output ID when start fails + code cleanup

Previously, an output that does not implement `info.get_output_type`
would result in these log messages saying `(null)`. This uses the actual
ID directly from the output itself instead.

Also removes two extra calls to `obs_encoder_set_video()` as they are
redundant and unnecessary.

(cherry picked from commit 8f0e5a72d6aa1129c02d03016fd1f5eac4ace2f0)
tt2468 2 ani în urmă
părinte
comite
a25a4c20b4
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      UI/window-basic-main-outputs.cpp

+ 2 - 2
UI/window-basic-main-outputs.cpp

@@ -1007,7 +1007,7 @@ bool SimpleOutput::StartStreaming(obs_service_t *service)
 	else
 		lastError = string();
 
-	const char *type = obs_service_get_output_type(service);
+	const char *type = obs_output_get_id(streamOutput);
 	blog(LOG_WARNING, "Stream output type '%s' failed to start!%s%s", type,
 	     hasLastError ? "  Last Error: " : "", hasLastError ? error : "");
 	return false;
@@ -1906,7 +1906,7 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service)
 	else
 		lastError = string();
 
-	const char *type = obs_service_get_output_type(service);
+	const char *type = obs_output_get_id(streamOutput);
 	blog(LOG_WARNING, "Stream output type '%s' failed to start!%s%s", type,
 	     hasLastError ? "  Last Error: " : "", hasLastError ? error : "");
 	return false;