|
@@ -59,31 +59,23 @@ static uint64_t tick_sources(uint64_t cur_time, uint64_t last_time)
|
|
|
/* ------------------------------------- */
|
|
|
/* call the tick function of each source */
|
|
|
|
|
|
- da_resize(data->source_iteration_list, 0);
|
|
|
-
|
|
|
pthread_mutex_lock(&data->sources_mutex);
|
|
|
|
|
|
source = data->first_source;
|
|
|
while (source) {
|
|
|
struct obs_source *cur_source = obs_source_get_ref(source);
|
|
|
+
|
|
|
if (cur_source)
|
|
|
- da_push_back(data->source_iteration_list, &cur_source);
|
|
|
+ obs_source_video_tick(cur_source, seconds);
|
|
|
|
|
|
source = (struct obs_source *)source->context.next;
|
|
|
+
|
|
|
+ if (cur_source)
|
|
|
+ obs_source_release(cur_source);
|
|
|
}
|
|
|
|
|
|
pthread_mutex_unlock(&data->sources_mutex);
|
|
|
|
|
|
- /* obs_source_release should not be called while iterating through
|
|
|
- * the global sources linked list, otherwise the linked list will
|
|
|
- * be compromised */
|
|
|
- for (size_t i = 0; i < data->source_iteration_list.num; i++) {
|
|
|
- struct obs_source *source =
|
|
|
- data->source_iteration_list.array[i];
|
|
|
- obs_source_video_tick(source, seconds);
|
|
|
- obs_source_release(source);
|
|
|
- }
|
|
|
-
|
|
|
return cur_time;
|
|
|
}
|
|
|
|