13
0

MTC drift patch from robin gareus, plus two related cleanups to the tracer & debug messages

git-svn-id: svn://localhost/ardour2/branches/3.0@7255 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-06-12 16:11:33 +00:00
parent fddb377812
commit f1fc47b077
2 changed files with 4 additions and 7 deletions

View File

@ -110,7 +110,7 @@ MidiTracer::tracer (Parser&, byte* msg, size_t len)
s = strftime (buf, bufsize, "%H:%M:%S", &now);
bufsize -= s;
s += snprintf (&buf[s], bufsize, ".%-9" PRId64, (int64_t) tv.tv_usec);
s += snprintf (&buf[s], bufsize, ".%06" PRId64, (int64_t) tv.tv_usec);
bufsize -= s;
switch ((eventType) msg[0]&0xf0) {

View File

@ -810,12 +810,11 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
/* Duration of one quarter frame */
nframes_t quarter_frame_duration = ((long) _frames_per_timecode_frame) >> 2;
DEBUG_TRACE (DEBUG::MTC, string_compose ("TF %1 SF %2 NQ %3 FD %\4n", _transport_frame, outbound_mtc_timecode_frame,
DEBUG_TRACE (DEBUG::MTC, string_compose ("TF %1 SF %2 NQ %3 FD %4\n", _transport_frame, outbound_mtc_timecode_frame,
next_quarter_frame_to_send, quarter_frame_duration));
// FIXME: this should always be true
//assert((outbound_mtc_timecode_frame + (next_quarter_frame_to_send * quarter_frame_duration))
// > _transport_frame);
assert((outbound_mtc_timecode_frame + (next_quarter_frame_to_send * quarter_frame_duration))
>= _transport_frame);
// Send quarter frames for this cycle
@ -887,8 +886,6 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
// Re-calculate timing of first quarter frame
//timecode_to_sample( transmitting_timecode_time, outbound_mtc_timecode_frame, true /* use_offset */, false );
outbound_mtc_timecode_frame += 8 * quarter_frame_duration;
// Compensate for audio latency
outbound_mtc_timecode_frame += _worst_output_latency;
}
}