libobs: Don't ignore starting audio if async

I when a source has both async audio/video capability, it would ignore
audio until the video has started.  There's really no need to do this,
when the video starts it'll just fix up the timing automatically.

This should fix the case where things like the media source would not be
able to play audio-only files.
This commit is contained in:
jp9000 2015-03-12 22:27:36 -07:00
parent 9832a760b8
commit 4fdd8fb570

View File

@ -1691,23 +1691,16 @@ void obs_source_output_audio(obs_source_t *source,
output = filter_async_audio(source, &source->audio_data);
if (output) {
bool async = (flags & OBS_SOURCE_ASYNC) != 0;
struct audio_data data;
for (int i = 0; i < MAX_AV_PLANES; i++)
data.data[i] = output->data[i];
data.frames = output->frames;
data.timestamp = output->timestamp;
pthread_mutex_lock(&source->audio_mutex);
/* wait for video to start before outputting any audio so we
* have a base for sync */
if (source->timing_set || !async) {
struct audio_data data;
for (int i = 0; i < MAX_AV_PLANES; i++)
data.data[i] = output->data[i];
data.frames = output->frames;
data.timestamp = output->timestamp;
source_output_audio_line(source, &data);
}
source_output_audio_line(source, &data);
pthread_mutex_unlock(&source->audio_mutex);
}