提交 5b209422 编写于 作者: J jp9000

win-wasapi: Subtract frame duration from timestamp

It would appear that the timestamp values returned by devices are not
perfectly accurate, and in some cases may be calculated on the spot --
to combat that, it's best to subtract the audio segment's duration from
the current audio segment's timestamp to ensure the timing is as
accurate as possible.
上级 008e38f5
......@@ -421,6 +421,9 @@ bool WASAPISource::ProcessCaptureData()
data.timestamp = useDeviceTiming ?
ts*100 : os_gettime_ns();
data.timestamp -= (uint64_t)frames * 1000000000ULL /
(uint64_t)sampleRate;
obs_source_output_audio(source, &data);
capture->ReleaseBuffer(frames);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册