From ee7fed36bca8030fbca2a8e4c41d9b181be33ac2 Mon Sep 17 00:00:00 2001 From: Mark Furneaux <mark@romaco.ca> Date: Wed, 30 Apr 2014 10:00:58 -0400 Subject: [PATCH] Fix pointer arithmetic when seeking buffers It's possible the sample type will change, so best to not use a fixed value. --- src/engines/gstengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engines/gstengine.cpp b/src/engines/gstengine.cpp index 524092b9b..baf0ae50e 100755 --- a/src/engines/gstengine.cpp +++ b/src/engines/gstengine.cpp @@ -287,7 +287,7 @@ void GstEngine::UpdateScope(int chunk_length_) { // pass the next chunk of the buffer to the analyser const sample_type* source = reinterpret_cast<sample_type*>(GST_BUFFER_DATA(latest_buffer_)); - source += (chunk_size / 2 * scope_chunk); + source += (chunk_size / sizeof(sample_type)) * scope_chunk; sample_type* dest = scope_.data(); const int bytes = qMin(