From fa8ae473cfa59f5678493b930c95b9671e08d183 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 4 Feb 2016 01:31:03 -0800 Subject: [PATCH] libobs: Fix bug where source audio could stop outputting If obs_source::audio_ts is set to 0 (such as by discard_if_stopped in obs-audio.c), but the push_back variable in the source_output_audio_data function in obs-source.c was being set to true (meaning it's within the seamless audio smoothing threshold), it would cause it to never reset the obs_source::audio_ts value, and thus all audio data from the source would become perpetually ignored by the audio subsystem until there was finally some sort of timestamp jump that caused it to call source_output_audio_place, and thus reset obs_source::audio_ts. obs_source::audio_ts is only reset in source_output_audio_place, not in source_output_audio_push_back, so the most simple solution is to just call source_output_audio_push_back is obs_source::audio_ts is 0. --- libobs/obs-source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index f945072ae..8b044ca5f 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -1179,7 +1179,7 @@ static void source_output_audio_data(obs_source_t *source, source->last_sync_offset = sync_offset; } - if (push_back) + if (push_back && source->audio_ts) source_output_audio_push_back(source, &in); else source_output_audio_place(source, &in);