projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
string fix up
[ardour.git]
/
libs
/
ardour
/
audio_buffer.cc
diff --git
a/libs/ardour/audio_buffer.cc
b/libs/ardour/audio_buffer.cc
index b4e2a55ac2e7d38452e4dda3a7517dbaf03880fa..de2c1ddf00b916701e889e9bae3f96ded2e9d807 100644
(file)
--- a/
libs/ardour/audio_buffer.cc
+++ b/
libs/ardour/audio_buffer.cc
@@
-57,12
+57,6
@@
AudioBuffer::resize (size_t size)
if (_data && size < _capacity) {
/* buffer is already large enough */
if (_data && size < _capacity) {
/* buffer is already large enough */
-
- if (size < _size) {
- /* truncate */
- _size = size;
- }
-
return;
}
return;
}
@@
-71,14
+65,13
@@
AudioBuffer::resize (size_t size)
cache_aligned_malloc ((void**) &_data, sizeof (Sample) * size);
_capacity = size;
cache_aligned_malloc ((void**) &_data, sizeof (Sample) * size);
_capacity = size;
- _size = 0;
_silent = false;
}
bool
_silent = false;
}
bool
-AudioBuffer::check_silence (pframes_t nframes,
bool wholebuffer,
pframes_t& n) const
+AudioBuffer::check_silence (pframes_t nframes, pframes_t& n) const
{
{
- for (n = 0;
(wholebuffer || n < _size) &&
n < nframes; ++n) {
+ for (n = 0; n < nframes; ++n) {
if (_data[n] != Sample (0)) {
return false;
}
if (_data[n] != Sample (0)) {
return false;
}
@@
-88,7
+81,7
@@
AudioBuffer::check_silence (pframes_t nframes, bool wholebuffer, pframes_t& n) c
void
AudioBuffer::silence (framecnt_t len, framecnt_t offset) {
void
AudioBuffer::silence (framecnt_t len, framecnt_t offset) {
- pframes_t n = 0;
+
if (!_silent) {
assert(_capacity > 0);
assert(offset + len <= _capacity);
if (!_silent) {
assert(_capacity > 0);
assert(offset + len <= _capacity);