Przeglądaj źródła

UI: Prevent re-updating of the stream encoder

Using advanced output mode, the stream encoder could be updated with the
same settings, causing the encoder to output those changes
unnecessarily.
jp9000 11 lat temu
rodzic
commit
2cc4c6e8d3
1 zmienionych plików z 13 dodań i 2 usunięć
  1. 13 2
      obs/window-basic-main-outputs.cpp

+ 13 - 2
obs/window-basic-main-outputs.cpp

@@ -609,7 +609,11 @@ void AdvancedOutput::SetupOutputs()
 
 
 bool AdvancedOutput::StartStreaming(obs_service_t *service)
 bool AdvancedOutput::StartStreaming(obs_service_t *service)
 {
 {
-	AdvancedOutput::Update();
+	if (!useStreamEncoder ||
+	    (!ffmpegRecording && !obs_output_active(fileOutput))) {
+		UpdateStreamSettings();
+	}
+
 	if (!Active())
 	if (!Active())
 		SetupOutputs();
 		SetupOutputs();
 
 
@@ -634,7 +638,14 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service)
 
 
 bool AdvancedOutput::StartRecording()
 bool AdvancedOutput::StartRecording()
 {
 {
-	AdvancedOutput::Update();
+	if (!useStreamEncoder) {
+		if (!ffmpegRecording) {
+			UpdateRecordingSettings();
+		}
+	} else if (!obs_output_active(streamOutput)) {
+		UpdateStreamSettings();
+	}
+
 	if (!Active())
 	if (!Active())
 		SetupOutputs();
 		SetupOutputs();