فهرست منبع

AudioStreamOggVorbis: only show invalid comment warning in Editor

nikitalita 1 ماه پیش
والد
کامیت
a09a5d2b47
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      modules/vorbis/audio_stream_ogg_vorbis.cpp

+ 5 - 0
modules/vorbis/audio_stream_ogg_vorbis.cpp

@@ -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);