提交 4fdd8fb5 编写于 作者: J jp9000

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.
上级 9832a760
......@@ -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;
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];
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);
}
data.frames = output->frames;
data.timestamp = output->timestamp;
pthread_mutex_lock(&source->audio_mutex);
source_output_audio_line(source, &data);
pthread_mutex_unlock(&source->audio_mutex);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册