summaryrefslogtreecommitdiff
path: root/libs/ardour/sndfilesource.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/sndfilesource.cc')
-rw-r--r--libs/ardour/sndfilesource.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc
index 3c3798c8ab..4b9c7ff33b 100644
--- a/libs/ardour/sndfilesource.cc
+++ b/libs/ardour/sndfilesource.cc
@@ -212,7 +212,7 @@ SndFileSource::init (string idstr)
_capture_end = false;
file_pos = 0;
- if (destructive()) {
+ if (destructive()) {
xfade_buf = new Sample[xfade_frames];
timeline_position = header_position_offset;
}
@@ -680,11 +680,15 @@ SndFileSource::set_destructive (bool yn)
{
if (yn) {
_flags = Flag (_flags | Destructive);
+ if (!xfade_buf) {
+ xfade_buf = new Sample[xfade_frames];
+ }
clear_capture_marks ();
timeline_position = header_position_offset;
} else {
_flags = Flag (_flags & ~Destructive);
timeline_position = 0;
+ /* leave xfade buf alone in case we need it again later */
}
return true;