From 3988c6d4b66bccc4a1bf047600d1a37c9b79600d Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 29 Jan 2016 23:18:02 -0800 Subject: [PATCH] libobs: Always render active audio sources when possible Fixes an issue where audio data would not be popped if they were not activated/presenting. This would cause the audio subsystem to needlessly buffer when they were reactivated again. Rendering all audio sources (excuding composite/filter sources) helps ensure that audio data is always popped and not left to pile up. --- libobs/obs-audio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libobs/obs-audio.c b/libobs/obs-audio.c index 619a74f63..0f09bc3aa 100644 --- a/libobs/obs-audio.c +++ b/libobs/obs-audio.c @@ -347,6 +347,16 @@ bool audio_callback(void *param, } } + pthread_mutex_lock(&data->audio_sources_mutex); + + source = data->first_audio_source; + while (source) { + push_audio_tree(NULL, source, audio); + source = (struct obs_source*)source->next_audio_source; + } + + pthread_mutex_unlock(&data->audio_sources_mutex); + /* ------------------------------------------------ */ /* render audio data */ for (size_t i = 0; i < audio->render_order.num; i++) {