summaryrefslogtreecommitdiff
path: root/package/kodi/0008-Fix-nullpadding-issue-when-reading-certain-id3v1-tag.patch
blob: dc428d6ced652fa8f6723b741e8803008f85d495 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
From 78571ed421e3fd3d5244cd76670e4e1bab69132f Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd.kuhls@t-online.de>
Date: Fri, 27 May 2016 17:30:28 +0200
Subject: [PATCH 1/1] Fix nullpadding issue when reading certain id3v1 tags

backported from upstream commit to master branch:

https://github.com/xbmc/xbmc/commit/cdabf9dd9e82f4b2d639fb769db08227a7c52046

to fix problems with taglib-1.11:

http://trac.kodi.tv/ticket/16454
https://github.com/taglib/taglib/issues/741#issuecomment-218059031

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 xbmc/music/tags/TagLoaderTagLib.cpp | 21 ---------------------
 xbmc/music/tags/TagLoaderTagLib.h   |  3 +++
 2 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/xbmc/music/tags/TagLoaderTagLib.cpp b/xbmc/music/tags/TagLoaderTagLib.cpp
index b78a591..0fc346a 100644
--- a/xbmc/music/tags/TagLoaderTagLib.cpp
+++ b/xbmc/music/tags/TagLoaderTagLib.cpp
@@ -46,31 +46,12 @@
 #include "utils/URIUtils.h"
 #include "utils/log.h"
 #include "utils/StringUtils.h"
-#include "utils/CharsetConverter.h"
 #include "utils/Base64.h"
 #include "settings/AdvancedSettings.h"
 
 using namespace TagLib;
 using namespace MUSIC_INFO;
 
-template<class T>
-class TagStringHandler : public T
-{
-public:
-  TagStringHandler() {}
-  virtual ~TagStringHandler() {}
-  virtual String parse(const ByteVector &data) const
-  {
-    std::string strSource(data.data(), data.size());
-    std::string strUTF8;
-    g_charsetConverter.unknownToUTF8(strSource, strUTF8);
-    return String(strUTF8, String::UTF8);
-  }
-};
-
-static const TagStringHandler<ID3v1::StringHandler> ID3v1StringHandler;
-static const TagStringHandler<ID3v2::Latin1StringHandler> ID3v2StringHandler;
-
 CTagLoaderTagLib::CTagLoaderTagLib()
 {
 }
@@ -824,8 +805,6 @@ bool CTagLoaderTagLib::Load(const std::string& strFileName, CMusicInfoTag& tag,
     return false;
   }
 
-  ID3v1::Tag::setStringHandler(&ID3v1StringHandler);
-  ID3v2::Tag::setLatin1StringHandler(&ID3v2StringHandler);
   TagLib::File*              file = NULL;
   TagLib::APE::File*         apeFile = NULL;
   TagLib::ASF::File*         asfFile = NULL;
diff --git a/xbmc/music/tags/TagLoaderTagLib.h b/xbmc/music/tags/TagLoaderTagLib.h
index f83ea4f..0edb84f 100644
--- a/xbmc/music/tags/TagLoaderTagLib.h
+++ b/xbmc/music/tags/TagLoaderTagLib.h
@@ -44,6 +44,9 @@
 #include <taglib/mp4tag.h>
 #include "ImusicInfoTagLoader.h"
 
+#include <string>
+#include <vector>
+
 namespace MUSIC_INFO
 {
   class CMusicInfoTag;
-- 
2.8.1