From 17e2c3f5bea30ae17812886ecef10b39f6bd9999 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Mon, 20 Aug 2018 08:47:41 -0400 Subject: [PATCH] Debug messages --- src/s_sound.c | 2 ++ src/sdl/mixer_sound.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index 340d6a1d3..e32403b9f 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1403,6 +1403,8 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U return; } + CONS_Debug(DBG_DETAILED, "Now playing song %s\n", newmusic); + if (digiexists && !nodigimusic && !digital_disabled) // digmusic? { if (prefadems && I_MusicType() != MU_MID) //have to queue post-fade // allow even if the music is the same diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 1b6823429..97a2c28c4 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -821,6 +821,12 @@ boolean I_StartDigSong(const char *musicname, boolean looping) return true; } + if (I_MusicType() == MU_MP3) + { + CONS_Debug(DBG_BASIC, "MP3 songs are unsupported and may crash! Use OGG instead.\n"); + CONS_Debug(DBG_DETAILED, "MP3 songs are unsupported and may crash! Use OGG instead.\n"); + } + // Find the OGG loop point. is_looping = looping; loop_point = 0.0f; @@ -928,6 +934,9 @@ boolean I_StartDigSong(const char *musicname, boolean looping) } } + if (!music_length && (I_MusicType() == MU_OGG || I_MusicType() == MU_MP3 || I_MusicType() == MU_FLAC)) + CONS_Debug(DBG_DETAILED, "This song is missing a LENGTHMS= tag! Required to make seeking work properly."); + if (I_MusicType() != MU_MOD && Mix_PlayMusic(music, 0) == -1) { CONS_Alert(CONS_ERROR, "Mix_PlayMusic: %s\n", Mix_GetError()); @@ -1040,7 +1049,7 @@ UINT32 I_GetMusicLength(void) // SDL mixer can't read music length itself. length = (UINT32)(music_length*1000); if (!length) - CONS_Debug(DBG_BASIC, "Getting music length: music is missing LENGTHMS= in music tag.\n"); + CONS_Debug(DBG_DETAILED, "Getting music length: music is missing LENGTHMS= tag. Needed for seeking.\n"); return length; } }