From 8f3d61984ecd9ecc97789a174a54c7f0505bddb4 Mon Sep 17 00:00:00 2001
From: Ron Economos <w6rz@comcast.net>
Date: Wed, 23 Sep 2020 21:13:12 -0700
Subject: gr-blocks: Fix wavfile sink and source block performance issues.
 Calling libsndfile sf_read/write_float() for every sample created too much
 overhead. sf_read/write_float() is now called every 1024 samples for the
 wavfile source block and every 8192 samples for the wavfile sink block.

---
 gr-blocks/lib/wavfile_source_impl.h | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'gr-blocks/lib/wavfile_source_impl.h')

diff --git a/gr-blocks/lib/wavfile_source_impl.h b/gr-blocks/lib/wavfile_source_impl.h
index 9554feab67..48a3b04f6a 100644
--- a/gr-blocks/lib/wavfile_source_impl.h
+++ b/gr-blocks/lib/wavfile_source_impl.h
@@ -26,6 +26,10 @@ private:
 
     wav_header_info d_h;
     long long d_sample_idx;
+    std::vector<float> d_buffer;
+
+    static constexpr int s_items_size = 1024;
+    static constexpr int s_max_channels = 24;
 
 public:
     wavfile_source_impl(const char* filename, bool repeat);
-- 
cgit v1.2.3