From 3be48f8f443f62f6f1db473e54bc13653134ea9d Mon Sep 17 00:00:00 2001 From: Mark Furneaux Date: Sat, 4 Oct 2014 10:39:33 -0400 Subject: [PATCH] unref buffers going to analyser at the right time This unrefs the buffer after the last chunk is pulled from it. --- src/engines/gstengine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/engines/gstengine.cpp b/src/engines/gstengine.cpp index 51798253d..7f903ff7b 100755 --- a/src/engines/gstengine.cpp +++ b/src/engines/gstengine.cpp @@ -317,6 +317,11 @@ void GstEngine::UpdateScope(int chunk_length) { memcpy(dest, source, bytes); gst_buffer_unmap(latest_buffer_, &map); + + if (scope_chunk_ == scope_chunks_) { + gst_buffer_unref(latest_buffer_); + latest_buffer_ = nullptr; + } } void GstEngine::StartPreloading(const QUrl& url, bool force_stop_at_end,