Browse Source

obs-outputs: Fix invalid stream key error

Fixes an issue where it would show the wrong error when the user entered
an invalid stream key, and logs it

Closes jp9000/obs-studio#1015
Quinn Damerell 8 years ago
parent
commit
1151c6cede
1 changed files with 10 additions and 4 deletions
  1. 10 4
      plugins/obs-outputs/ftl-stream.c

+ 10 - 4
plugins/obs-outputs/ftl-stream.c

@@ -644,10 +644,16 @@ static int try_connect(struct ftl_stream *stream)
 
 	status_code = ftl_ingest_connect(&stream->ftl_handle);
 	if (status_code != FTL_SUCCESS) {
-		warn("Ingest connect failed with: %s (%d)",
-				ftl_status_code_to_string(status_code),
-				status_code);
-		return _ftl_error_to_obs_error(status_code);
+		if (status_code == FTL_BAD_OR_INVALID_STREAM_KEY) {
+			blog(LOG_ERROR, "Invalid Key (%s)",
+					ftl_status_code_to_string(status_code));
+			return OBS_OUTPUT_INVALID_STREAM;
+		} else {
+			warn("Ingest connect failed with: %s (%d)",
+					ftl_status_code_to_string(status_code),
+					status_code);
+			return _ftl_error_to_obs_error(status_code);
+		}
 	}
 
 	info("Connection to %s successful", stream->path.array);