fix for crash caused as slave is switching from non-TC source to TC-source
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 12 Nov 2012 16:48:50 +0000 (16:48 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 12 Nov 2012 16:48:50 +0000 (16:48 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13453 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_clock.cc

index bb92cb7ae414d853ccd2b16221729102792e545a..b6c969a502713ca7c7645398e48fdaf6cbdeb8b0 100644 (file)
@@ -1044,14 +1044,12 @@ AudioClock::set_slave_info ()
                                TimecodeSlave* tcslave;
                                if ((tcslave = dynamic_cast<TimecodeSlave*>(_session->slave())) != 0) {
                                        matching = (tcslave->apparent_timecode_format() == _session->config.get_timecode_format());
-                               } else {
-                                       matching = true;
+                                       _left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"%2\">%3</span>",
+                                                                                 INFO_FONT_SIZE, (matching?X_("green"):X_("red")),
+                                                                                 dynamic_cast<TimecodeSlave*>(slave)->approximate_current_position()));
+                                       _right_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
+                                                                                  INFO_FONT_SIZE, slave->approximate_current_delta()));
                                }
-                               _left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"%2\">%3</span>",
-                                                       INFO_FONT_SIZE, (matching?"green":"red"),
-                                                       dynamic_cast<TimecodeSlave*>(slave)->approximate_current_position()));
-                               _right_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
-                                                       INFO_FONT_SIZE, slave->approximate_current_delta()));
                        } else {
                                _left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
                                                        INFO_FONT_SIZE, _("--pending--")));