summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/audio_buffer.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-12-28 13:43:44 +0100
committerRobin Gareus <robin@gareus.org>2013-12-28 13:43:44 +0100
commit37264c85a509aca4a4ea71e8e2c5d32c81956879 (patch)
treec8079dd59194ff1ccaca9126ed0ac2a2fb804de6 /libs/ardour/ardour/audio_buffer.h
parent8f69af4af3f5da403fceffbcdf5e7d61ddfcaaca (diff)
centralize buffer silent-flag
fixes possible x-talk 1 in, >= 2 out tracks: Previously, only the first route-buffer of the input buffers were marked as non-silent in Route::process_output_buffers(). Other buffers in the set (e.g. post-panner) would contain audio but not marked as non-silent.
Diffstat (limited to 'libs/ardour/ardour/audio_buffer.h')
-rw-r--r--libs/ardour/ardour/audio_buffer.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h
index 054a1f7b45..c356ed82b9 100644
--- a/libs/ardour/ardour/audio_buffer.h
+++ b/libs/ardour/ardour/audio_buffer.h
@@ -33,17 +33,7 @@ public:
AudioBuffer(size_t capacity);
~AudioBuffer();
- void silence (framecnt_t len, framecnt_t offset = 0) {
- if (!_silent) {
- assert(_capacity > 0);
- assert(offset + len <= _capacity);
- memset(_data + offset, 0, sizeof (Sample) * len);
- if (len == _capacity) {
- _silent = true;
- }
- }
- _written = true;
- }
+ void silence (framecnt_t len, framecnt_t offset = 0);
/** Read @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
void read_from (const Sample* src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
@@ -204,10 +194,11 @@ public:
Sample* data (framecnt_t offset = 0) {
assert(offset <= _capacity);
+ _silent = false;
return _data + offset;
}
- bool check_silence (pframes_t, pframes_t&) const;
+ bool check_silence (pframes_t, bool, pframes_t&) const;
void prepare () { _written = false; _silent = false; }
bool written() const { return _written; }