|
|
|
|
@ -39,6 +39,19 @@ int main() {
|
|
|
|
|
assert(take(e)); consume(e, devices); |
|
|
|
|
assert(capture.captureJumps == 0 && capture.captureMissing == 0 && capture.captureEstimated == 1); |
|
|
|
|
assert(capture.captureSequence == 1920 && capture.captureBlocks == 1 && capture.captureFrames == 480); |
|
|
|
|
// Отсутствующий timestamp не превращается в измеренную нулевую задержку.
|
|
|
|
|
audio_playback_timing output{30000, 1000, 1200, 48000, 1}; |
|
|
|
|
audio_diag_playback_clock(nullptr, &output); |
|
|
|
|
output.latency_us = -1000; output.frames = 960; |
|
|
|
|
audio_diag_playback_clock(nullptr, &output); |
|
|
|
|
output.latency_us = 999999; output.measured = 0; |
|
|
|
|
audio_diag_playback_clock(nullptr, &output); |
|
|
|
|
while (take(e)) consume(e, devices); |
|
|
|
|
assert(capture.playbackBlocks == 3 && capture.playbackFrames == 3120 && capture.playbackMeasured == 2); |
|
|
|
|
assert(capture.playbackMinLatency == -1000 && capture.playbackMaxLatency == 30000); |
|
|
|
|
assert(capture.playbackMaxBlock == 25000 && capture.playbackMaxConverter == 1000); |
|
|
|
|
report(devices, now(CLOCK_MONOTONIC), 1.0); |
|
|
|
|
assert(capture.playbackBlocks == 0 && capture.playbackMeasured == 0 && capture.playbackMaxBlock == 0); |
|
|
|
|
std::vector<std::thread> workers; |
|
|
|
|
for (int p = 0; p < producers; ++p) workers.emplace_back([p, &done]() { |
|
|
|
|
for (int i = 0; i < perProducer; ++i) |
|
|
|
|
|