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
master
jp9000 2015-01-05 01:16:47 -08:00
parent c1289b893e
commit 0f09834c68
1 changed files with 9 additions and 2 deletions

View File

@ -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;
}