From 7793b65f584d05b096dfbef5f6ede019b7d19f5c Mon Sep 17 00:00:00 2001 From: Andrea Bondavalli Date: Sun, 5 Dec 2021 12:28:56 +0100 Subject: [PATCH] Added fix to latency wqtool to avoid crash if no samples were collecteA d --- test/latency.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/latency.cc b/test/latency.cc index b1855d8..c5b8482 100644 --- a/test/latency.cc +++ b/test/latency.cc @@ -734,7 +734,10 @@ int main(int argc, char *argv[]) snd_pcm_hw_free(chandle); } - printf("End to end latency: %lu ms\n", end_to_end_latency / end_to_end_samples); + if (end_to_end_samples) + printf("End to end latency: %lu ms\n", end_to_end_latency / end_to_end_samples); + else + printf("End to end latency: no samples collected\n"); snd_pcm_close(phandle); snd_pcm_close(chandle); return 0;