13
0

MTC timing: compensate for audio latency.

git-svn-id: svn://localhost/trunk/ardour2@268 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Per Sigmond 2006-01-12 19:17:06 +00:00
parent cd93691e16
commit b1fdf3a399
2 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -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;
}
}
}