+ timecode.hours = msg[3];
+ timecode.minutes = msg[2];
+ timecode.seconds = msg[1];
+ timecode.frames = msg[0];
+
+ last_mtc_fps_byte = msg[4];
+
+ switch (msg[4]) {
+ case MTC_24_FPS:
+ timecode.rate = 24;
+ timecode.drop = false;
+ tc_format = timecode_24;
+ can_notify_on_unknown_rate = true;
+ break;
+ case MTC_25_FPS:
+ timecode.rate = 25;
+ timecode.drop = false;
+ tc_format = timecode_25;
+ can_notify_on_unknown_rate = true;
+ break;
+ case MTC_30_FPS_DROP:
+ timecode.rate = 30;
+ timecode.drop = true;
+ tc_format = timecode_30drop;
+ can_notify_on_unknown_rate = true;
+ break;
+ case MTC_30_FPS:
+ timecode.rate = 30;
+ timecode.drop = false;
+ can_notify_on_unknown_rate = true;
+ tc_format = timecode_30;
+ break;
+ default:
+ /* throttle error messages about unknown MTC rates */
+ if (can_notify_on_unknown_rate) {
+ error << string_compose (_("Unknown rate/drop value %1 in incoming MTC stream, session values used instead"),
+ (int) msg[4])
+ << endmsg;
+ can_notify_on_unknown_rate = false;
+ }
+ timecode.rate = session.timecode_frames_per_second();
+ timecode.drop = session.timecode_drop_frames();
+ reset_tc = false;
+ }
+
+ if (reset_tc) {
+ if (!did_reset_tc_format) {
+ saved_tc_format = session.config.get_timecode_format();
+ did_reset_tc_format = true;
+ }
+ session.config.set_timecode_format (tc_format);
+ }
+
+ DEBUG_TRACE (DEBUG::MTC, string_compose ("MTC time timestamp = %1 TC %2 = frame %3 (from full message ? %4)\n",
+ now, timecode, mtc_frame, was_full));
+