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.
This commit is contained in:
jp9000 2016-02-04 01:31:03 -08:00
parent ac3b2a08ad
commit fa8ae473cf

View File

@ -1179,7 +1179,7 @@ static void source_output_audio_data(obs_source_t *source,
source->last_sync_offset = sync_offset; source->last_sync_offset = sync_offset;
} }
if (push_back) if (push_back && source->audio_ts)
source_output_audio_push_back(source, &in); source_output_audio_push_back(source, &in);
else else
source_output_audio_place(source, &in); source_output_audio_place(source, &in);