Browse Source

UI: Report more detailed output errors if available

Richard Stanway 8 years ago
parent
commit
0c0ffb341c
1 changed files with 15 additions and 3 deletions
  1. 15 3
      UI/window-basic-main-outputs.cpp

+ 15 - 3
UI/window-basic-main-outputs.cpp

@@ -910,9 +910,15 @@ bool SimpleOutput::StartRecording()
 	if (!ConfigureRecording(false))
 		return false;
 	if (!obs_output_start(fileOutput))  {
+		QString error_reason;
+		const char *error = obs_output_get_last_error(fileOutput);
+		if (error)
+			error_reason = QT_UTF8(error);
+		else
+			error_reason = QTStr("Output.StartFailedGeneric");
 		QMessageBox::critical(main,
-				QTStr("Output.StartRecordingFailed"),
-				QTStr("Output.StartFailedGeneric"));
+			QTStr("Output.StartRecordingFailed"),
+			error_reason);
 		return false;
 	}
 
@@ -1528,9 +1534,15 @@ bool AdvancedOutput::StartRecording()
 	}
 
 	if (!obs_output_start(fileOutput)) {
+		QString error_reason;
+		const char *error = obs_output_get_last_error(fileOutput);
+		if (error)
+			error_reason = QT_UTF8(error);
+		else
+			error_reason = QTStr("Output.StartFailedGeneric");
 		QMessageBox::critical(main,
 				QTStr("Output.StartRecordingFailed"),
-				QTStr("Output.StartFailedGeneric"));
+				error_reason);
 		return false;
 	}