|
@@ -542,18 +542,34 @@ bool audio_callback(void *param, uint64_t start_ts_in, uint64_t end_ts_in,
|
|
|
#endif
|
|
|
|
|
|
/* ------------------------------------------------ */
|
|
|
- /* build audio render order
|
|
|
- * NOTE: these are source channels, not audio channels */
|
|
|
- for (uint32_t i = 0; i < MAX_CHANNELS; i++) {
|
|
|
- obs_source_t *source = obs_get_output_source(i);
|
|
|
- if (source) {
|
|
|
+ /* build audio render order */
|
|
|
+
|
|
|
+ pthread_mutex_lock(&obs->video.mixes_mutex);
|
|
|
+ for (size_t j = 0; j < obs->video.mixes.num; j++) {
|
|
|
+ struct obs_view *view = obs->video.mixes.array[j]->view;
|
|
|
+ if (!view)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ pthread_mutex_lock(&view->channels_mutex);
|
|
|
+
|
|
|
+ /* NOTE: these are source channels, not audio channels */
|
|
|
+ for (uint32_t i = 0; i < MAX_CHANNELS; i++) {
|
|
|
+ obs_source_t *source = view->channels[i];
|
|
|
+ if (!source)
|
|
|
+ continue;
|
|
|
+ if (!obs_source_active(source))
|
|
|
+ continue;
|
|
|
+
|
|
|
obs_source_enum_active_tree(source, push_audio_tree,
|
|
|
audio);
|
|
|
push_audio_tree(NULL, source, audio);
|
|
|
- da_push_back(audio->root_nodes, &source);
|
|
|
- obs_source_release(source);
|
|
|
+
|
|
|
+ if (view == &obs->data.main_view)
|
|
|
+ da_push_back(audio->root_nodes, &source);
|
|
|
}
|
|
|
+ pthread_mutex_unlock(&view->channels_mutex);
|
|
|
}
|
|
|
+ pthread_mutex_unlock(&obs->video.mixes_mutex);
|
|
|
|
|
|
pthread_mutex_lock(&data->audio_sources_mutex);
|
|
|
|