summaryrefslogtreecommitdiff
path: root/libs/ardour/session_click.cc
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2005-12-06 15:14:37 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2005-12-06 15:14:37 +0000
commitf04aa5e49a1633f6cf39b8bb1872725332370b52 (patch)
tree3d9fccb9fdcc93e31304dc4892939d85712af28f /libs/ardour/session_click.cc
parent857f1163d4054ea66a7281deabdf771c03dcad42 (diff)
some treeview headings and session click fix
git-svn-id: svn://localhost/trunk/ardour2@174 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_click.cc')
-rw-r--r--libs/ardour/session_click.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/ardour/session_click.cc b/libs/ardour/session_click.cc
index d97d29cc18..250adfe4cc 100644
--- a/libs/ardour/session_click.cc
+++ b/libs/ardour/session_click.cc
@@ -95,15 +95,22 @@ Session::click (jack_nframes_t start, jack_nframes_t nframes, jack_nframes_t off
clk = *i;
next = i;
++next;
-
+
if (clk->start < start) {
internal_offset = 0;
} else {
internal_offset = clk->start - start;
}
+ if (nframes < internal_offset) {
+ /* we've just located or something..
+ effectively going backwards.
+ lets get the flock out of here */
+ break;
+ }
+
copy = min (clk->duration - clk->offset, nframes - internal_offset);
-
+
memcpy (buf + internal_offset, &clk->data[clk->offset], copy * sizeof (Sample));
clk->offset += copy;