From 7b8793f6c3dec005cd537454f8521ec3ce3d1d60 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Mon, 18 Apr 2022 18:48:21 +0900 Subject: [PATCH] libobs: Log audio timestamp exceeding TS_SMOOTHING_THRESHOLD Timestamp of some of audio sources desync over the time and audio glitch is suspected to be caused when the difference between `timestamp` and `next_audio_ts_min` exceeds TS_SMOOTHING_THRESHOLD. When such condition happens, leave a log message to investigate the glitch of the audio. --- libobs/obs-source.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index c5a00a5fa..bb2f73ba8 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -1479,6 +1479,12 @@ static void source_output_audio_data(obs_source_t *source, if (source->async_unbuffered && source->async_decoupled) source->timing_adjust = os_time - in.timestamp; in.timestamp = source->next_audio_ts_min; + } else { + blog(LOG_DEBUG, + "Audio timestamp for '%s' exceeded TS_SMOOTHING_THRESHOLD, diff=%" PRIu64 + " ns, expected %" PRIu64 ", input %" PRIu64, + source->context.name, diff, + source->next_audio_ts_min, in.timestamp); } }