Update Timecode Generator/Slave alignment
This commit is contained in:
@@ -390,7 +390,7 @@ LTC_Slave::process_ltc(samplepos_t const /*now*/)
|
||||
timecode_negative_offset, timecode_offset
|
||||
);
|
||||
|
||||
ltc_frame += ltc_slave_latency.max + session.worst_playback_latency();
|
||||
ltc_frame += ltc_slave_latency.max;
|
||||
|
||||
samplepos_t cur_timestamp = sample.off_end + 1;
|
||||
DEBUG_TRACE (DEBUG::LTC, string_compose ("LTC F: %1 LF: %2 N: %3 L: %4\n", ltc_frame, last_ltc_sample, cur_timestamp, last_timestamp));
|
||||
|
||||
@@ -263,16 +263,15 @@ Session::ltc_tx_send_time_code_for_cycle (samplepos_t start_sample, samplepos_t
|
||||
* buffer.
|
||||
*
|
||||
* The timecode is generated directly in the Session process callback
|
||||
* using _transport_sample. It requires that the session has set the
|
||||
* port's playback latency to worst_playback_latency() prior to
|
||||
* calling ltc_tx_send_time_code_for_cycle().
|
||||
* using _transport_sample (which is the audible frame at the
|
||||
* output).
|
||||
*/
|
||||
samplepos_t cycle_start_sample;
|
||||
|
||||
if (current_speed < 0) {
|
||||
cycle_start_sample = (start_sample - ltc_out_latency.max + worst_playback_latency());
|
||||
cycle_start_sample = (start_sample + ltc_out_latency.max);
|
||||
} else if (current_speed > 0) {
|
||||
cycle_start_sample = (start_sample + ltc_out_latency.max - worst_playback_latency());
|
||||
cycle_start_sample = (start_sample - ltc_out_latency.max);
|
||||
} else {
|
||||
/* There is no need to compensate for latency when not rolling
|
||||
* rather send the accurate NOW timecode
|
||||
|
||||
@@ -417,7 +417,7 @@ Session::send_full_time_code (samplepos_t const t, MIDI::pframes_t nframes)
|
||||
|
||||
LatencyRange mtc_out_latency = {0, 0}; // TODO cache this, update on engine().GraphReordered()
|
||||
_midi_ports->mtc_output_port ()->get_connected_latency_range (ltc_out_latency, true);
|
||||
sampleoffset_t mtc_offset = worst_playback_latency() - mtc_out_latency.max;
|
||||
sampleoffset_t mtc_offset = mtc_out_latency.max;
|
||||
|
||||
// only if rolling.. ?
|
||||
outbound_mtc_timecode_frame += mtc_offset;
|
||||
|
||||
Reference in New Issue
Block a user