From eb8c47226987d83a08d455cdaf2cfa49c5a60e72 Mon Sep 17 00:00:00 2001 From: mio Date: Sun, 18 Aug 2024 22:52:56 +1000 Subject: Fix mime type registration for FLAC with taglib>=2 The TAGLIB_*_VERSION macros are not (and never have been) defined in tag.h, however, tag.h used to include tstring.h, which included taglib.h [0]. KFlacPlugin doesn't use the 'name' argument in it's constructor so it can support earlier versions of taglib (< 1.2), instead, it registers the mime type info for both 'audio/x-flac' and 'audio/x-oggflac' when it is first loaded. However, since 'audio/x-oggflac' was never being registered (because TAGLIB_1_2 wasn't defined), when KRenamer attempted to get the mime type info for 'audio/x-oggflac', the call failed and it's 'keys' member was never altered, causing the additional 'flac' to be appended [1]. [0]: https://github.com/taglib/taglib/commit/a08acdcf23c5d4ac4cb795f5edfdc539055138b7#diff-83ce8ae463020e723895af7e50380bc507f358a2d56313767d5305a759bb9f02 [1]: https://mirror.git.trinitydesktop.org/gitea/TDE/krename/src/branch/r14.1.x/krename/fileplugin.cpp#L46-L98 Fixes: https://mirror.git.trinitydesktop.org/gitea/TDE/tdemultimedia/issues/77 Signed-off-by: mio --- tdefile-plugins/flac/tdefile_flac.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tdefile-plugins/flac/tdefile_flac.cpp b/tdefile-plugins/flac/tdefile_flac.cpp index 3ee4efa2..d99721e0 100644 --- a/tdefile-plugins/flac/tdefile_flac.cpp +++ b/tdefile-plugins/flac/tdefile_flac.cpp @@ -38,6 +38,7 @@ #include #include +#include #if (TAGLIB_MAJOR_VERSION>1) || \ ((TAGLIB_MAJOR_VERSION==1) && (TAGLIB_MINOR_VERSION>=2)) #define TAGLIB_1_2 -- cgit v1.2.1