win-capture: Fix hook collisions with multiple game captures
Before this change, after a game capture source would send a signal to init or restart a graphics hook, it would respond to any and all hook ready signals. With multiple game capture sources in the same scene, a source could receive the signal intended for another source, and show the wrong texture. This change adds the window handle to the name for shared data with the hook, resulting in hooks for other sources being ignored.
This commit is contained in:
@@ -1251,8 +1251,13 @@ static inline enum capture_result init_capture_data(struct game_capture *gc)
|
||||
|
||||
CloseHandle(gc->hook_data_map);
|
||||
|
||||
gc->hook_data_map = open_map_plus_id(gc, SHMEM_TEXTURE,
|
||||
gc->global_hook_info->map_id);
|
||||
wchar_t name[64];
|
||||
_snwprintf(name, 64, L"%s_%d_", SHMEM_TEXTURE,
|
||||
(uint32_t)(uintptr_t)gc->window);
|
||||
|
||||
gc->hook_data_map =
|
||||
open_map_plus_id(gc, name, gc->global_hook_info->map_id);
|
||||
|
||||
if (!gc->hook_data_map) {
|
||||
DWORD error = GetLastError();
|
||||
if (error == 2) {
|
||||
|
Reference in New Issue
Block a user