summaryrefslogtreecommitdiff
path: root/libs/ardour/session_time.cc
diff options
context:
space:
mode:
authorJohannes Mueller <github@johannes-mueller.org>2017-06-09 21:24:57 +0200
committerRobin Gareus <robin@gareus.org>2017-06-10 18:30:42 +0200
commit2770444b0c6893c78d340b3d6c1a4e306be8b960 (patch)
tree015de3d88387a95dcb44fc5e379d6bf6b9840766 /libs/ardour/session_time.cc
parentae837b49ed8d00c484cf7e99f3485e67c94daf79 (diff)
Make Session::backend_sync_callback() emit Session::Located
If we sync to jackd AudioEngine::transport_frame() is not yet updated when Session emits Located. Then the playhead ends up in an obsolete position. Therefore we emit Session::Located() also from within Session::backend_sync_callback() as that is called when AudioEngine is done with the relocation.
Diffstat (limited to 'libs/ardour/session_time.cc')
-rw-r--r--libs/ardour/session_time.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc
index 3b3be8f3b2..64641e302b 100644
--- a/libs/ardour/session_time.cc
+++ b/libs/ardour/session_time.cc
@@ -183,19 +183,26 @@ int
Session::backend_sync_callback (TransportState state, framepos_t pos)
{
bool slave = synced_to_engine();
+ // cerr << "Session::backend_sync_callback() _transport_frame: " << _transport_frame << " pos: " << pos << " audible_frame: " << audible_frame() << endl;
+
+ if (slave) {
+ // cerr << "Session::backend_sync_callback() emitting Located()" << endl;
+ Located (); /* EMIT SIGNAL */
+ }
switch (state) {
case TransportStopped:
if (slave && _transport_frame != pos && post_transport_work() == 0) {
request_locate (pos, false);
- // cerr << "SYNC: stopped, locate to " << pos->frame << " from " << _transport_frame << endl;
+ // cerr << "SYNC: stopped, locate to " << pos << " from " << _transport_frame << endl;
return false;
} else {
+ // cerr << "SYNC: stopped, nothing to do" << endl;
return true;
}
case TransportStarting:
- // cerr << "SYNC: starting @ " << pos->frame << " a@ " << _transport_frame << " our work = " << post_transport_work() << " pos matches ? " << (_transport_frame == pos->frame) << endl;
+ // cerr << "SYNC: starting @ " << pos << " a@ " << _transport_frame << " our work = " << post_transport_work() << " pos matches ? " << (_transport_frame == pos) << endl;
if (slave) {
return _transport_frame == pos && post_transport_work() == 0;
} else {