From 08aa7c9087dce89e6fd14b4cd0a4adda83d3fd81 Mon Sep 17 00:00:00 2001 From: Dav999 Date: Wed, 6 May 2026 23:47:29 +0200 Subject: [PATCH] Remove nuisance Vorbis errors on blank music slots When vvvvvvmusic.vvv files contain blank slots before the last valid song, the following error message would be output for all of them: [ERROR] Unable to create Vorbis handle, error 30 Now, this is very common: many levels, for example, ship a music file where songs start at slot 16, or alternatively they used slots 0-15 but didn't need every slot. Or IDs are skipped so that certain songs are on their own page in the music editor. Either way, I've seen bursts of this message appear in my console a lot when loading levels lol, so it became time this was silenced by not bothering to load a <=1 byte song, and giving a (silenced by default) debug message in that case instead. (It checks for <= 1 byte, because in all these cases, the empty slots have a single null byte in them. I looked up why that is again, and it is because, in 2019, "Rumor goes that 0-byte tracks actually mess things up in VVVVVV". We could probably verify if that's the case now, but music files have been made this way for ages, and it's pretty clear a 1-byte song is not usable.) --- desktop_version/src/Music.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 7cff1b84..bc7f87a1 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -381,6 +381,12 @@ public: MusicTrack(SDL_RWops *rw, const char* _id, bool _loose_extra) { SDL_zerop(this); + if (rw->size(rw) <= 1) + { + // Don't bother + vlog_debug("Skipping empty music track"); + goto end; + } read_buf = (Uint8*) SDL_malloc(rw->size(rw)); SDL_RWread(rw, read_buf, rw->size(rw), 1); int err;