summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormio <stigma@disroot.org>2024-08-18 22:52:56 +1000
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-08-19 20:06:51 +0900
commit0fb5d8ad1fb2c76f5d1adf287676d924b398cf99 (patch)
tree565f52f61ef5894f844b4286af7dbe0f782e183f
parent62d445589d029e4ed6d16df0aa179f5e34e297ad (diff)
downloadtdemultimedia-0fb5d8ad1fb2c76f5d1adf287676d924b398cf99.tar.gz
tdemultimedia-0fb5d8ad1fb2c76f5d1adf287676d924b398cf99.zip
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 <stigma@disroot.org> (cherry picked from commit eb8c47226987d83a08d455cdaf2cfa49c5a60e72)
-rw-r--r--tdefile-plugins/flac/tdefile_flac.cpp1
1 files changed, 1 insertions, 0 deletions
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 <ksavefile.h>
#include <tag.h>
+#include <taglib.h>
#if (TAGLIB_MAJOR_VERSION>1) || \
((TAGLIB_MAJOR_VERSION==1) && (TAGLIB_MINOR_VERSION>=2))
#define TAGLIB_1_2