From 0f09834c68f52461f47ec8e97fedd4f9b707064d Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 5 Jan 2015 01:16:47 -0800 Subject: [PATCH] win-capture: Change error message for file mapping If shared memory file mapping fails, I've found that it's somewhat normal due to something in windows -- usually the capture will always eventually start up after a few tries. Only seems to apply to some games though, for example seems to happen with counterstrike a lot for some strange reason. Capture always eventually starts back up though. I remember seeing this with OBS1 as well in many cases but always thought it was some sort of fluke --- plugins/win-capture/game-capture.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/win-capture/game-capture.c b/plugins/win-capture/game-capture.c index 92b3acc1f..2216664d9 100644 --- a/plugins/win-capture/game-capture.c +++ b/plugins/win-capture/game-capture.c @@ -817,8 +817,15 @@ static inline bool init_capture_data(struct game_capture *gc) gc->hook_data_map = OpenFileMappingA(FILE_MAP_ALL_ACCESS, false, name); if (!gc->hook_data_map) { - warn("init_capture_data: failed to open file mapping: %lu", - GetLastError()); + DWORD error = GetLastError(); + if (error == 2) { + info("init_capture_data: file mapping not found, " + "retrying. (this is often normal, and may take " + "a few tries)"); + } else { + warn("init_capture_data: failed to open file " + "mapping: %lu", error); + } return false; }