summaryrefslogtreecommitdiff
path: root/libs/ardour/diskstream.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-01-28 16:54:25 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-01-28 16:54:25 +0000
commit9ca089d20dee0f0e74014086a7d8ac2c41c6e898 (patch)
tree354c5ecb0c49308fdcd3d5ee207c7487d0204976 /libs/ardour/diskstream.cc
parent4e2d99fd211f92130e9d07365af0ea14d511ed59 (diff)
important bug fix in handling GUI messages; destructive tracks now operational (lots of GUI stuff to fix for them)
git-svn-id: svn://localhost/trunk/ardour2@302 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/diskstream.cc')
-rw-r--r--libs/ardour/diskstream.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc
index b19f25be72..09f9fcdd9d 100644
--- a/libs/ardour/diskstream.cc
+++ b/libs/ardour/diskstream.cc
@@ -1062,7 +1062,9 @@ DiskStream::seek (jack_nframes_t frame, bool complete_refill)
(*chan).capture_buf->reset ();
if (destructive()) {
DestructiveFileSource* dfs = dynamic_cast<DestructiveFileSource*> ((*chan).write_source);
- dfs->seek (frame);
+ if (dfs) {
+ dfs->seek (frame);
+ }
}
}
@@ -2007,7 +2009,20 @@ DiskStream::reset_write_sources (bool mark_write_complete, bool force)
}
if (!force && destructive()) {
- return;
+
+ /* make sure we always have enough sources for the current channel count */
+
+ for (chan = channels.begin(), n = 0; chan != channels.end(); ++chan, ++n) {
+ if ((*chan).write_source == 0) {
+ break;
+ }
+ }
+
+ if (chan == channels.end()) {
+ return;
+ }
+
+ /* some channels do not have a write source */
}
capturing_sources.clear ();