Skip to content

Commit 717c255

Browse files
committed
Only process MT-32 debug messages in debug builds
1 parent b653dc6 commit 717c255

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/midi/midi_mt32.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,17 @@ static mt32emu_report_handler_i get_report_handler_interface()
527527
}
528528

529529
static void printDebug([[maybe_unused]] void* instance_data,
530-
const char* fmt, va_list list)
530+
[[maybe_unused]] const char* fmt,
531+
[[maybe_unused]] va_list list)
531532
{
532-
char msg[1024];
533-
safe_sprintf(msg, fmt, list);
534-
LOG_DEBUG("MT32: %s", msg);
533+
#if !defined(NDEBUG)
534+
// Skip processing MT-32 debug output in release builds
535+
// because it can be bursty
536+
char msg[1024] = "MT32: ";
537+
assert(fmt);
538+
safe_strcat(msg, fmt);
539+
LOG_DEBUG(msg, list);
540+
#endif
535541
}
536542

537543
static void onErrorControlROM(void*)

0 commit comments

Comments
 (0)