1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-03 11:50:27 +00:00

AudioStreamOggVorbis: only show invalid comment warning in Editor

This commit is contained in:
nikitalita
2025-10-24 09:47:48 -07:00
parent 37764110f6
commit a09a5d2b47

View File

@@ -460,14 +460,19 @@ void AudioStreamOggVorbis::maybe_update_info() {
}
Dictionary dictionary;
// Comments are required by the Vorbis spec to be structured like env vars, i.e. VAR=VALUE.
// This is how tags are stored (artist, album, etc.), and we parse them out for display.
// See https://xiph.org/vorbis/doc/v-comment.html
for (int i = 0; i < comment.comments; i++) {
String c = String::utf8(comment.user_comments[i]);
int equals = c.find_char('=');
#ifdef TOOLS_ENABLED
if (equals == -1) {
WARN_PRINT(vformat(R"(Invalid comment in Ogg Vorbis file "%s", should contain '=': "%s".)", get_path(), c));
continue;
}
#endif
String tag = c.substr(0, equals);
String tag_value = c.substr(equals + 1);