summaryrefslogtreecommitdiff
path: root/libs/ardour/session_transport.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-04-12 22:35:06 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-04-12 22:35:06 +0000
commit981c8906fb9d2fc5b2071018a22947a87f6bd5db (patch)
tree4a7735cfb7d9fc1e4d94c5e3856d76894065b735 /libs/ardour/session_transport.cc
parentac8c7e427fd778201297469fb6ce189142e29ffa (diff)
alignment/capture/positioning changes ported from 2.X
git-svn-id: svn://localhost/ardour2/branches/3.0@6886 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_transport.cc')
-rw-r--r--libs/ardour/session_transport.cc30
1 files changed, 25 insertions, 5 deletions
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index e5b580e2ab..12dc1c3d3d 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -197,10 +197,17 @@ Session::realtime_stop (bool abort, bool clear_state)
/* move the transport position back to where the
request for a stop was noticed. we rolled
- past that point to pick up delayed input.
+ past that point to pick up delayed input (and/or to delick)
*/
- decrement_transport_position (_worst_output_latency);
+ if (_worst_output_latency > current_block_size) {
+ /* we rolled past the stop point to pick up data that had
+ not yet arrived. move back to where the stop occured.
+ */
+ decrement_transport_position (current_block_size + (_worst_output_latency - current_block_size));
+ } else {
+ decrement_transport_position (current_block_size);
+ }
/* the duration change is not guaranteed to have happened, but is likely */
@@ -1011,9 +1018,13 @@ Session::stop_transport (bool abort, bool clear_state)
return;
}
- if (actively_recording() && !(transport_sub_state & StopPendingCapture) &&
- _worst_output_latency > current_block_size)
- {
+ if (actively_recording() && !(transport_sub_state & StopPendingCapture) && _worst_output_latency > current_block_size) {
+
+ boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
+
+ for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
+ (*i)->prepare_to_stop (_transport_frame);
+ }
/* we need to capture the audio that has still not yet been received by the system
at the time the stop is requested, so we have to roll past that time.
@@ -1035,6 +1046,15 @@ Session::stop_transport (bool abort, bool clear_state)
if ((transport_sub_state & PendingDeclickOut) == 0) {
+
+ if (!(transport_sub_state & StopPendingCapture)) {
+ boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
+
+ for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
+ (*i)->prepare_to_stop (_transport_frame);
+ }
+ }
+
transport_sub_state |= PendingDeclickOut;
/* we'll be called again after the declick */
pending_abort = abort;