Skip to content

Commit

Permalink
vkcapture: Don't disconnect from client on hide
Browse files Browse the repository at this point in the history
This partialy reverts commit ee0be72.

Matches behavior of Windows Game Capture source.

Closes #162
  • Loading branch information
nowrep committed Sep 5, 2023
1 parent 9534554 commit c69db4a
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/vkcapture.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,35 +397,6 @@ static void activate_client(vkcapture_source_t *ctx, vkcapture_client_t *client,
client->timeout = clock_ns() + 5000000000; // 5s timeout
}

static void vkcapture_source_show(void *data)
{
vkcapture_source_t *ctx = data;

if (ctx->client_id) {
pthread_mutex_lock(&server.mutex);
vkcapture_client_t *client = find_client_by_id(ctx->client_id);
if (client) {
activate_client(ctx, client, true);
}
pthread_mutex_unlock(&server.mutex);
}
}

static void vkcapture_source_hide(void *data)
{
vkcapture_source_t *ctx = data;

if (ctx->client_id) {
pthread_mutex_lock(&server.mutex);
vkcapture_client_t *client = find_client_by_id(ctx->client_id);
if (client) {
activate_client(ctx, client, false);
destroy_texture(ctx);
}
pthread_mutex_unlock(&server.mutex);
}
}

static void vkcapture_source_video_tick(void *data, float seconds)
{
vkcapture_source_t *ctx = data;
Expand Down Expand Up @@ -650,8 +621,6 @@ static struct obs_source_info vkcapture_input = {
.create = vkcapture_source_create,
.destroy = vkcapture_source_destroy,
.update = vkcapture_source_update,
.show = vkcapture_source_show,
.hide = vkcapture_source_hide,
.video_tick = vkcapture_source_video_tick,
.video_render = vkcapture_source_render,
.get_width = vkcapture_source_get_width,
Expand Down

0 comments on commit c69db4a

Please sign in to comment.