From d7792a4fca5a136653a6a4cf504a719e2719d612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 9 Dec 2017 14:03:18 +0200 Subject: [PATCH] Fix calculation for buffer duration in basic-tutorial-8 We need to scale the number of samples, not the buffer size. --- tutorials/src/bin/basic-tutorial-8.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/src/bin/basic-tutorial-8.rs b/tutorials/src/bin/basic-tutorial-8.rs index 2aaa5ba41..e9719c754 100644 --- a/tutorials/src/bin/basic-tutorial-8.rs +++ b/tutorials/src/bin/basic-tutorial-8.rs @@ -164,7 +164,7 @@ fn main() { .mul_div_floor(data.num_samples, SAMPLE_RATE as u64) .expect("u64 overflow"); let duration = gst::SECOND - .mul_div_floor(CHUNK_SIZE as u64, SAMPLE_RATE as u64) + .mul_div_floor(num_samples as u64, SAMPLE_RATE as u64) .expect("u64 overflow"); {