Skip to content

Commit

Permalink
Merge pull request #285 from matt335672/fix_monitor_hotplug
Browse files Browse the repository at this point in the history
Fix monitor hotplug
  • Loading branch information
metalefty authored Feb 20, 2024
2 parents e108fec + b493abd commit e9a85dd
Show file tree
Hide file tree
Showing 5 changed files with 416 additions and 316 deletions.
27 changes: 27 additions & 0 deletions module/rdpCapture.c
Original file line number Diff line number Diff line change
Expand Up @@ -1162,3 +1162,30 @@ rdpCapture(rdpClientCon *clientCon, RegionPtr in_reg, BoxPtr *out_rects,
}
return FALSE;
}

/**
* Reset any capture state fields following a memory resize
*****************************************************************************/
void
rdpCaptureResetState(rdpClientCon *clientCon)
{
int mode;
int i;

LLOGLN(10, ("rdpCapReset:"));
mode = clientCon->client_info.capture_code;
switch (mode)
{
case 2:
case 4:
for (i = 0 ; i < 16; ++i)
{
free(clientCon->rfx_crcs[i]);
clientCon->rfx_crcs[i] = NULL;
clientCon->num_rfx_crcs_alloc[i] = 0;
}
break;
default:
break;
}
}
3 changes: 3 additions & 0 deletions module/rdpCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ extern _X_EXPORT Bool
rdpCapture(rdpClientCon *clientCon, RegionPtr in_reg, BoxPtr *out_rects,
int *num_out_rects, struct image_data *id);

extern _X_EXPORT void
rdpCaptureResetState(rdpClientCon *clientCon);

extern _X_EXPORT int
a8r8g8b8_to_a8b8g8r8_box(const uint8_t *s8, int src_stride,
uint8_t *d8, int dst_stride,
Expand Down
Loading

0 comments on commit e9a85dd

Please sign in to comment.