Skip to content

Commit

Permalink
libobs: Fix wrong order for requesting source->async_mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
walker-WSH committed Jan 1, 2025
1 parent a0e4e37 commit 863fc6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libobs/obs-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,9 @@ static void async_tick(obs_source_t *source)
{
uint64_t sys_time = obs->video.video_time;

/* gs should be requested before async_mutex
Here we request gs because set_async_texture_size may be called */
gs_enter_context(obs->video.graphics);
pthread_mutex_lock(&source->async_mutex);

if (deinterlacing_enabled(source)) {
Expand All @@ -1208,6 +1211,7 @@ static void async_tick(obs_source_t *source)
source->async_update_texture = set_async_texture_size(source, source->cur_async_frame);

pthread_mutex_unlock(&source->async_mutex);
gs_leave_context();
}

void obs_source_video_tick(obs_source_t *source, float seconds)
Expand Down

0 comments on commit 863fc6c

Please sign in to comment.