summaryrefslogtreecommitdiff
path: root/libs/ardour/sndfilesource.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-01-09 23:24:54 +0000
committerDavid Robillard <d@drobilla.net>2007-01-09 23:24:54 +0000
commit532f6aad4ac79ca15d69deccd18fca90e444c437 (patch)
tree0d4ca5449af8eb48ad56e163efcab42c4656e8de /libs/ardour/sndfilesource.cc
parentef6b25432d9c46d71b08c0f7d5f2686df428c4e8 (diff)
Merged with trunk R1283.
NOTE: Compiles, but broken (crash on adding MIDI track). git-svn-id: svn://localhost/ardour2/branches/midi@1292 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/sndfilesource.cc')
-rw-r--r--libs/ardour/sndfilesource.cc29
1 files changed, 14 insertions, 15 deletions
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc
index a30bfcf49b..8e90eac6ab 100644
--- a/libs/ardour/sndfilesource.cc
+++ b/libs/ardour/sndfilesource.cc
@@ -408,26 +408,25 @@ SndFileSource::nondestructive_write_unlocked (Sample *data, nframes_t cnt)
PeakBuildRecord *pbr = 0;
if (pending_peak_builds.size()) {
- pbr = pending_peak_builds.back();
- }
+ pbr = pending_peak_builds.back();
+ }
- if (pbr && pbr->frame + pbr->cnt == oldlen) {
-
- /* the last PBR extended to the start of the current write,
- so just extend it again.
- */
-
- pbr->cnt += cnt;
- } else {
- pending_peak_builds.push_back (new PeakBuildRecord (oldlen, cnt));
- }
+ if (pbr && pbr->frame + pbr->cnt == oldlen) {
- _peaks_built = false;
+ /* the last PBR extended to the start of the current write,
+ so just extend it again.
+ */
+ pbr->cnt += cnt;
+ } else {
+ pending_peak_builds.push_back (new PeakBuildRecord (oldlen, cnt));
+ }
+
+ _peaks_built = false;
}
if (_build_peakfiles) {
- queue_for_peaks (shared_from_this ());
+ queue_for_peaks (shared_from_this (), false);
}
_write_data_count = cnt;
@@ -540,7 +539,7 @@ SndFileSource::destructive_write_unlocked (Sample* data, nframes_t cnt)
}
if (_build_peakfiles) {
- queue_for_peaks (shared_from_this ());
+ queue_for_peaks (shared_from_this (), true);
}
return cnt;