libobs: Fix race condition when adding a filter
The source would sometimes be rendered before the code to add it to the filter chain was executed, therefore it would cause a crash.
This commit is contained in:
parent
b1ba8561ff
commit
502f4005f1
@ -1269,12 +1269,13 @@ void obs_source_filter_add(obs_source_t *source, obs_source_t *filter)
|
||||
(*back)->filter_target = filter;
|
||||
}
|
||||
|
||||
filter->filter_parent = source;
|
||||
filter->filter_target = source;
|
||||
|
||||
da_push_back(source->filters, &filter);
|
||||
|
||||
pthread_mutex_unlock(&source->filter_mutex);
|
||||
|
||||
filter->filter_parent = source;
|
||||
filter->filter_target = source;
|
||||
calldata_set_ptr(&cd, "source", source);
|
||||
calldata_set_ptr(&cd, "filter", filter);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user