diff options
Diffstat (limited to 'src/server/Buffer.hpp')
-rw-r--r-- | src/server/Buffer.hpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp index 8742445f..939f1f87 100644 --- a/src/server/Buffer.hpp +++ b/src/server/Buffer.hpp @@ -101,16 +101,6 @@ public: return NULL; } - /// Audio buffers only - inline SampleCount nframes() const { - if (is_control()) { - return 1; - } else if (is_audio()) { - return (_capacity / sizeof(Sample)); - } - return 0; - } - /// Numeric buffers only inline Sample value_at(SampleCount offset) const { if (is_audio() || is_control()) { @@ -126,7 +116,7 @@ public: const SampleCount end) { assert(is_audio() || is_control()); - assert(end <= nframes()); + assert(end <= _capacity / sizeof(Sample)); // Note: Do not change this without ensuring GCC can still vectorize it Sample* const buf = samples() + start; for (SampleCount i = 0; i < (end - start); ++i) { @@ -139,7 +129,7 @@ public: const SampleCount end) { assert(is_audio() || is_control()); - assert(end <= nframes()); + assert(end <= _capacity / sizeof(Sample)); // Note: Do not change this without ensuring GCC can still vectorize it Sample* const buf = samples() + start; for (SampleCount i = 0; i < (end - start); ++i) { |