MTC drift patch from robin gareus, plus two related cleanups to the tracer & debug...
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 12 Jun 2010 16:11:33 +0000 (16:11 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 12 Jun 2010 16:11:33 +0000 (16:11 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7255 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/midi_tracer.cc
libs/ardour/session_midi.cc

index 3da5e33be9fc63eccc54cb85700b39e8b182a198..a9f38b52ff5a82c8841b4df9011a275face6e4a1 100644 (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) {
index 6035a8a077e6976e7d44e7b09c69fbe84523e5cb..0a6b490b5aa3f0c1613ec59379f2d5ca8136de46 100644 (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;
                }
        }