diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index 906a0372a4..cb35c0c785 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -113,10 +113,11 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full) /* We received the last quarter frame 7 quarter frames (1.75 mtc frames) after the instance when the contents of the mtc quarter frames were decided. Add time to compensate for the elapsed 1.75 - frames + frames. + Also compensate for audio latency. */ - mtc_frame += (long) (1.75 * session.frames_per_smpte_frame()); + mtc_frame += (long) (1.75 * session.frames_per_smpte_frame()) + session.worst_output_latency(); if (first_mtc_frame == 0) { first_mtc_frame = mtc_frame; diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index 56e593086a..f793dba956 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -910,6 +910,9 @@ Session::send_full_time_code () } } + // Compensate for audio latency + outbound_mtc_smpte_frame += _worst_output_latency; + next_quarter_frame_to_send = 0; // Sync slave to the same smpte time as we are on (except if negative, see above) @@ -1007,6 +1010,8 @@ Session::send_midi_time_code () smpte_increment( transmitting_smpte_time ); // Re-calculate timing of first quarter frame smpte_to_sample( transmitting_smpte_time, outbound_mtc_smpte_frame, true /* use_offset */, false ); + // Compensate for audio latency + outbound_mtc_smpte_frame += _worst_output_latency; } } }