提交 ac3b2a08 编写于 作者: J jp9000

libobs: Don't call discard_if_stopped if not minor data

Only allow discard_if_stopped to be called if the audio data is marked
as pending, and the pending audio data is below the audio tick threshold
size.
上级 cded9cb1
......@@ -125,6 +125,8 @@ static bool discard_if_stopped(obs_source_t *source, size_t channels)
}
}
#define MAX_AUDIO_SIZE (AUDIO_OUTPUT_FRAMES * sizeof(float))
static inline void discard_audio(struct obs_core_audio *audio,
obs_source_t *source, size_t channels, size_t sample_rate,
struct ts_info *ts)
......@@ -152,8 +154,11 @@ static inline void discard_audio(struct obs_core_audio *audio,
}
if (source->audio_ts < (ts->start - 1)) {
if (discard_if_stopped(source, channels))
if (source->audio_pending &&
source->audio_input_buf[0].size < MAX_AUDIO_SIZE &&
discard_if_stopped(source, channels))
return;
#if DEBUG_AUDIO == 1
if (is_audio_source) {
blog(LOG_DEBUG, "can't discard, source "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册