0008-Fix-nullpadding-issue-when-reading-certain-id3v1-tag.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 78571ed421e3fd3d5244cd76670e4e1bab69132f Mon Sep 17 00:00:00 2001
  2. From: Bernd Kuhls <bernd.kuhls@t-online.de>
  3. Date: Fri, 27 May 2016 17:30:28 +0200
  4. Subject: [PATCH 1/1] Fix nullpadding issue when reading certain id3v1 tags
  5. backported from upstream commit to master branch:
  6. https://github.com/xbmc/xbmc/commit/cdabf9dd9e82f4b2d639fb769db08227a7c52046
  7. to fix problems with taglib-1.11:
  8. http://trac.kodi.tv/ticket/16454
  9. https://github.com/taglib/taglib/issues/741#issuecomment-218059031
  10. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  11. ---
  12. xbmc/music/tags/TagLoaderTagLib.cpp | 21 ---------------------
  13. xbmc/music/tags/TagLoaderTagLib.h | 3 +++
  14. 2 files changed, 3 insertions(+), 21 deletions(-)
  15. diff --git a/xbmc/music/tags/TagLoaderTagLib.cpp b/xbmc/music/tags/TagLoaderTagLib.cpp
  16. index b78a591..0fc346a 100644
  17. --- a/xbmc/music/tags/TagLoaderTagLib.cpp
  18. +++ b/xbmc/music/tags/TagLoaderTagLib.cpp
  19. @@ -46,31 +46,12 @@
  20. #include "utils/URIUtils.h"
  21. #include "utils/log.h"
  22. #include "utils/StringUtils.h"
  23. -#include "utils/CharsetConverter.h"
  24. #include "utils/Base64.h"
  25. #include "settings/AdvancedSettings.h"
  26. using namespace TagLib;
  27. using namespace MUSIC_INFO;
  28. -template<class T>
  29. -class TagStringHandler : public T
  30. -{
  31. -public:
  32. - TagStringHandler() {}
  33. - virtual ~TagStringHandler() {}
  34. - virtual String parse(const ByteVector &data) const
  35. - {
  36. - std::string strSource(data.data(), data.size());
  37. - std::string strUTF8;
  38. - g_charsetConverter.unknownToUTF8(strSource, strUTF8);
  39. - return String(strUTF8, String::UTF8);
  40. - }
  41. -};
  42. -
  43. -static const TagStringHandler<ID3v1::StringHandler> ID3v1StringHandler;
  44. -static const TagStringHandler<ID3v2::Latin1StringHandler> ID3v2StringHandler;
  45. -
  46. CTagLoaderTagLib::CTagLoaderTagLib()
  47. {
  48. }
  49. @@ -824,8 +805,6 @@ bool CTagLoaderTagLib::Load(const std::string& strFileName, CMusicInfoTag& tag,
  50. return false;
  51. }
  52. - ID3v1::Tag::setStringHandler(&ID3v1StringHandler);
  53. - ID3v2::Tag::setLatin1StringHandler(&ID3v2StringHandler);
  54. TagLib::File* file = NULL;
  55. TagLib::APE::File* apeFile = NULL;
  56. TagLib::ASF::File* asfFile = NULL;
  57. diff --git a/xbmc/music/tags/TagLoaderTagLib.h b/xbmc/music/tags/TagLoaderTagLib.h
  58. index f83ea4f..0edb84f 100644
  59. --- a/xbmc/music/tags/TagLoaderTagLib.h
  60. +++ b/xbmc/music/tags/TagLoaderTagLib.h
  61. @@ -44,6 +44,9 @@
  62. #include <taglib/mp4tag.h>
  63. #include "ImusicInfoTagLoader.h"
  64. +#include <string>
  65. +#include <vector>
  66. +
  67. namespace MUSIC_INFO
  68. {
  69. class CMusicInfoTag;
  70. --
  71. 2.8.1