Browse Source

obs-ffmpeg: Use gai_strerrorA for error logging on Windows

Avoids wide characters in the format string which cause truncation.

(cherry picked from commit 668775f4f0d5b85cc934b3c3602c1d2bd798a889)
Richard Stanway 2 years ago
parent
commit
3464772d3c
1 changed files with 7 additions and 1 deletions
  1. 7 1
      plugins/obs-ffmpeg/obs-ffmpeg-srt.h

+ 7 - 1
plugins/obs-ffmpeg/obs-ffmpeg-srt.h

@@ -485,7 +485,13 @@ static int libsrt_setup(URLContext *h, const char *uri)
 	if (ret) {
 		blog(LOG_ERROR,
 		     "[obs-ffmpeg mpegts muxer / libsrt]: Failed to resolve hostname %s: %s",
-		     hostname, gai_strerror(ret));
+		     hostname,
+#ifdef _WIN32
+		     gai_strerrorA(ret)
+#else
+		     gai_strerror(ret)
+#endif
+		);
 		return OBS_OUTPUT_CONNECT_FAILED;
 	}