summaryrefslogtreecommitdiff
path: root/libs/ardour/audiosource.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-05-29 14:38:25 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-05-29 14:38:25 +0000
commit489d2ba1a76c64a935808591571ca63a053172c8 (patch)
tree8cd12e3f53b7ffaa15271650b3b7c0b0253e1b86 /libs/ardour/audiosource.cc
parentc3821a78162fe6d89455ab5ed4e925bafec2a845 (diff)
don't always rebuild peakfiles for compound regions
git-svn-id: svn://localhost/ardour2/branches/3.0@9627 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audiosource.cc')
-rw-r--r--libs/ardour/audiosource.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index 25e1d2222d..de6c5edfec 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -252,8 +252,14 @@ AudioSource::initialize_peakfile (bool newfile, string audio_path)
int err = stat (audio_path.c_str(), &stat_file);
if (err) {
- _peaks_built = false;
- _peak_byte_max = 0;
+
+ /* no audio path - nested source or we can't
+ read it or ... whatever, use the peakfile as-is.
+ */
+
+ _peaks_built = true;
+ _peak_byte_max = statbuf.st_size;
+
} else {
/* allow 6 seconds slop on checking peak vs. file times because of various
@@ -996,6 +1002,8 @@ AudioSource::ensure_buffers_for_level_locked (uint32_t level, framecnt_t frame_r
_mixdown_buffers.clear ();
_gain_buffers.clear ();
+ cerr << "Allocating nested buffers for level " << level << endl;
+
while (_mixdown_buffers.size() < level) {
_mixdown_buffers.push_back (boost::shared_ptr<Sample> (new Sample[nframes]));
_gain_buffers.push_back (boost::shared_ptr<gain_t> (new gain_t[nframes]));