瀏覽代碼

libobs: Log if CreateProcessW fails on Windows

This is used by the test programs as well as ffmpeg-mux. If a process
fails to start it's quite bad so we would like to know why.
Richard Stanway 2 年之前
父節點
當前提交
fef92a8a43
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      libobs/util/pipe-windows.c

+ 5 - 0
libobs/util/pipe-windows.c

@@ -70,6 +70,11 @@ static inline bool create_process(const char *cmd_line, HANDLE stdin_handle,
 		if (success) {
 			*process = pi.hProcess;
 			CloseHandle(pi.hThread);
+		} else {
+			// Not logging the full command line is intentional
+			// as it may contain stream keys etc.
+			blog(LOG_ERROR, "CreateProcessW failed: %lu",
+			     GetLastError());
 		}
 
 		bfree(cmd_line_w);