From 5137e54c52768538049b50d5c711dca687e3809f Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 14 Dec 2021 11:11:56 +0300
Subject: [PATCH] allow loud debug prints in timidity if DEBUG_CHATTER is
defined.
(keep forgetting to apply this patch)
---
src/codecs/timidity/common.h | 4 ++++
src/codecs/timidity/readmidi.c | 7 +++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/codecs/timidity/common.h b/src/codecs/timidity/common.h
index 69d5f5f3..1b2b1caa 100644
--- a/src/codecs/timidity/common.h
+++ b/src/codecs/timidity/common.h
@@ -22,6 +22,10 @@ extern void timi_free_pathlist(void);
#define TIMI_NAMESPACE(x) _timi_ ## x
/* debug output */
+#ifdef DEBUG_CHATTER
+#define SNDDBG(X) SDL_Log X
+#else
#define SNDDBG(X)
+#endif
#endif /* TIMIDITY_COMMON_H */
diff --git a/src/codecs/timidity/readmidi.c b/src/codecs/timidity/readmidi.c
index 18e5f4e1..00ab3fa7 100644
--- a/src/codecs/timidity/readmidi.c
+++ b/src/codecs/timidity/readmidi.c
@@ -44,7 +44,7 @@ static Sint32 getvl(SDL_RWops *rw)
}
}
-#if 0 /* SNDDBG() is just an empty macro */
+#if (defined DEBUG_CHATTER)
/* Print a string from the file, followed by a newline. Any non-ASCII
or unprintable characters will be converted to periods. */
static int dumpstring(SDL_RWops *rw, Sint32 len, Uint8 type)
@@ -119,8 +119,11 @@ static MidiEventList *read_midi_event(MidiSong *song)
len=getvl(song->rw);
if (type>0 && type<16)
{
- /*dumpstring(song->rw, len, type);*/ /* see above */
+ #if (defined DEBUG_CHATTER)
+ dumpstring(song->rw, len, type);
+ #else
SDL_RWseek(song->rw, len, RW_SEEK_CUR);
+ #endif
}
else
switch(type)