metadata.c get_metadata_ex add flag METADATA_EXCLUDE_NORMALIZE

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Thu, 25 Jun 2026 13:43:21 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 22b4cd323252dd53a545ec327fa2ff772ce34c13
Author: William Wilgus <[email protected]>
Date:   Thu Jun 25 13:41:22 2026 -0400

    metadata.c get_metadata_ex add flag METADATA_EXCLUDE_NORMALIZE
    
    no need to normalize data you don't intend to use
    
    Change-Id: Ieef5474fef47b2f96db3d02875db95a1de02eb5e

diff --git a/lib/rbcodec/metadata/metadata.c b/lib/rbcodec/metadata/metadata.c
index 446eb34ab1..4e42735b88 100644
--- a/lib/rbcodec/metadata/metadata.c
+++ b/lib/rbcodec/metadata/metadata.c
@@ -475,7 +475,7 @@ bool get_metadata_ex(struct mp3entry* id3, int fd, const char* trackname, int fl
     }
 
 #ifdef UTF8PROC_EXPORTS
-    if (success) {
+    if (success && (flags & METADATA_EXCLUDE_NORMALIZE) == 0) {
         utf8_normalize(id3->title);
         utf8_normalize(id3->artist);
         utf8_normalize(id3->album);
diff --git a/lib/rbcodec/metadata/metadata.h b/lib/rbcodec/metadata/metadata.h
index 5f9d03a527..110bee1f7d 100644
--- a/lib/rbcodec/metadata/metadata.h
+++ b/lib/rbcodec/metadata/metadata.h
@@ -23,8 +23,9 @@
 
 #include "platform.h"
 
-#define METADATA_EXCLUDE_ID3_PATH (0x01) /* don't copy filename path to the id3 path buffer */
-#define METADATA_CLOSE_FD_ON_EXIT (0x02) /* close the filedescriptor when finished */
+#define METADATA_EXCLUDE_ID3_PATH  (0x01) /* don't copy filename path to the id3 path buffer */
+#define METADATA_CLOSE_FD_ON_EXIT  (0x02) /* close the filedescriptor when finished */
+#define METADATA_EXCLUDE_NORMALIZE (0x04) /* don't normalize id3 text entries */
 /* Audio file types. */
 /* NOTE: The values of the AFMT_* items are used for the %fc tag in the WPS
          - so new entries MUST be added to the end to maintain compatibility.
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs