+
+ mtc_frame += (long) (1.75 * session.frames_per_timecode_frame()) + session.worst_output_latency();
+
+ if (now) {
+ double speed = compute_apparent_speed (now);
+
+ current.guard1++;
+ current.position = mtc_frame;
+ current.timestamp = now;
+ current.speed = speed;
+ current.guard2++;
+ }
+ }
+
+ if (now) {
+ last_inbound_frame = now;
+ }
+}
+
+double
+MTC_Slave::compute_apparent_speed (nframes64_t now)
+{
+ if (current.timestamp != 0) {
+
+ double speed = (double) ((mtc_frame - current.position) / (double) (now - current.timestamp));
+ DEBUG_TRACE (DEBUG::MTC, string_compose ("instantaneous speed = %1 from %2 / %3\n",
+ speed, mtc_frame - current.position, now - current.timestamp));
+
+ /* crude low pass filter/smoother for speed */