win-capture: Fix memory capture crash on new capture
If the target process re-creates its D3D context, the game capture tick can trigger before the capture is setup, in which case OBS gets a CAPTURE_RETRY message. However with the memory capture method, it continues to try and copy from the shared memory pointer which is no longer valid, resulting in a crash. The fix uses the old texture until the next tick at which point the new capture should be ready for use.master
parent
cf9f016820
commit
66ec96d52c
|
@ -1429,12 +1429,17 @@ static inline void copy_16bit_tex(struct game_capture *gc, int cur_texture,
|
|||
|
||||
static void copy_shmem_tex(struct game_capture *gc)
|
||||
{
|
||||
int cur_texture = gc->shmem_data->last_tex;
|
||||
int cur_texture;
|
||||
HANDLE mutex = NULL;
|
||||
uint32_t pitch;
|
||||
int next_texture;
|
||||
uint8_t *data;
|
||||
|
||||
if (!gc->shmem_data)
|
||||
return;
|
||||
|
||||
cur_texture = gc->shmem_data->last_tex;
|
||||
|
||||
if (cur_texture < 0 || cur_texture > 1)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue