Don’t create MTC debug string if it’s not needed.
authorRobin Gareus <robin@gareus.org>
Wed, 29 Jul 2015 15:54:32 +0000 (17:54 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 29 Jul 2015 15:54:56 +0000 (17:54 +0200)
Removes periodic call to operator<< (and eventually loadlocale)
in RT-thread in the debug version.

libs/ardour/session_midi.cc

index 19fb39ba14348ccbab2dd46d56345fb769b052c4..a97f4055634d7f97b7692d02267095b886426d1d 100644 (file)
@@ -537,11 +537,13 @@ Session::send_midi_time_code_for_cycle (framepos_t start_frame, framepos_t end_f
                }
 
 #ifndef NDEBUG
-               DEBUG_STR_DECL(foo)
-               DEBUG_STR_APPEND(foo,"sending ");
-               DEBUG_STR_APPEND(foo, transmitting_timecode_time);
-               DEBUG_TRACE (DEBUG::MTC, string_compose ("%1 qfm = %2, stamp = %3\n", DEBUG_STR(foo).str(), next_quarter_frame_to_send,
-                                                        out_stamp));
+               if (DEBUG_ENABLED(DEBUG::MTC)) {
+                       DEBUG_STR_DECL(foo)
+                       DEBUG_STR_APPEND(foo,"sending ");
+                       DEBUG_STR_APPEND(foo, transmitting_timecode_time);
+                       DEBUG_TRACE (DEBUG::MTC, string_compose ("%1 qfm = %2, stamp = %3\n", DEBUG_STR(foo).str(), next_quarter_frame_to_send,
+                                                                out_stamp));
+               }
 #endif
 
                // Increment quarter frame counter