From f04aa5e49a1633f6cf39b8bb1872725332370b52 Mon Sep 17 00:00:00 2001 From: Nick Mainsbridge Date: Tue, 6 Dec 2005 15:14:37 +0000 Subject: some treeview headings and session click fix git-svn-id: svn://localhost/trunk/ardour2@174 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_click.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libs') 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; -- cgit v1.2.3