]> git.pld-linux.org Git - packages/vlc.git/blob - vlc-taglib2.patch
- added taglib2 patch (adjust for taglib 2.0.x; should be compatible with 1.13)
[packages/vlc.git] / vlc-taglib2.patch
1 --- vlc-3.0.20/modules/meta_engine/taglib.cpp.orig      2023-04-23 01:27:28.000000000 +0200
2 +++ vlc-3.0.20/modules/meta_engine/taglib.cpp   2024-05-28 20:53:38.455427736 +0200
3 @@ -57,6 +57,7 @@
4                                     TAGLIB_PATCH_VERSION)
5  
6  #define TAGLIB_VERSION_1_11 VERSION_INT(1,11,0)
7 +#define TAGLIB_VERSION_2 VERSION_INT(2,0,0)
8  
9  #if TAGLIB_VERSION >= TAGLIB_VERSION_1_11
10  #include <tfilestream.h>
11 @@ -185,7 +186,7 @@ public:
12          ByteVector res(length, 0);
13          ssize_t i_read = vlc_stream_Read( m_stream, res.data(), length);
14          if (i_read < 0)
15 -            return ByteVector::null;
16 +            return ByteVector();
17          else if ((size_t)i_read != length)
18              res.resize(i_read);
19          return res;
20 @@ -237,12 +238,20 @@ public:
21          return;
22      }
23  
24 +#if TAGLIB_VERSION >= TAGLIB_VERSION_2
25 +    offset_t tell() const
26 +#else
27      long tell() const
28 +#endif
29      {
30          return m_previousPos;
31      }
32  
33 +#if TAGLIB_VERSION >= TAGLIB_VERSION_2
34 +    offset_t length()
35 +#else
36      long length()
37 +#endif
38      {
39          uint64_t i_size;
40          if (vlc_stream_GetSize( m_stream, &i_size ) != VLC_SUCCESS)
41 @@ -465,7 +474,7 @@ static void ReadMetaFromASF( ASF::Tag* t
42  static void ReadMetaFromBasicTag(const Tag* tag, vlc_meta_t *dest)
43  {
44  #define SET( accessor, meta )                                                  \
45 -    if( !tag->accessor().isNull() && !tag->accessor().isEmpty() )              \
46 +    if( !tag->accessor().isEmpty() )              \
47          vlc_meta_Set##meta( dest, tag->accessor().toCString(true) )
48  #define SETINT( accessor, meta )                                               \
49      if( tag->accessor() )                                                      \
50 @@ -806,15 +815,15 @@ static void ReadMetaFromMP4( MP4::Tag* t
51  {
52      MP4::Item list;
53  #define SET( keyName, metaName )                                                             \
54 -    if( tag->itemListMap().contains(keyName) )                                               \
55 +    if( tag->contains(keyName) )                                               \
56      {                                                                                        \
57 -        list = tag->itemListMap()[keyName];                                                  \
58 +        list = tag->item(keyName);                                                  \
59          vlc_meta_Set##metaName( p_meta, list.toStringList().front().toCString( true ) );     \
60      }
61  #define SET_EXTRA( keyName, metaName )                                                   \
62 -    if( tag->itemListMap().contains(keyName) )                                  \
63 +    if( tag->contains(keyName) )                                  \
64      {                                                                                \
65 -        list = tag->itemListMap()[keyName];                                     \
66 +        list = tag->item(keyName);                                     \
67          vlc_meta_AddExtra( p_meta, metaName, list.toStringList().front().toCString( true ) ); \
68      }
69  
70 @@ -824,9 +833,9 @@ static void ReadMetaFromMP4( MP4::Tag* t
71  #undef SET
72  #undef SET_EXTRA
73  
74 -    if( tag->itemListMap().contains("covr") )
75 +    if( tag->contains("covr") )
76      {
77 -        MP4::CoverArtList list = tag->itemListMap()["covr"].toCoverArtList();
78 +        MP4::CoverArtList list = tag->item("covr").toCoverArtList();
79          const char *psz_format = list[0].format() == MP4::CoverArt::PNG ? "image/png" : "image/jpeg";
80  
81          msg_Dbg( p_demux_meta, "Found embedded art (%s) is %i bytes",
82 @@ -1337,7 +1346,7 @@ static int WriteMeta( vlc_object_t *p_th
83          if( RIFF::AIFF::File* riff_aiff = dynamic_cast<RIFF::AIFF::File*>(f.file()) )
84              WriteMetaToId3v2( riff_aiff->tag(), p_item );
85          else if( RIFF::WAV::File* riff_wav = dynamic_cast<RIFF::WAV::File*>(f.file()) )
86 -            WriteMetaToId3v2( riff_wav->tag(), p_item );
87 +            WriteMetaToId3v2( riff_wav->ID3v2Tag(), p_item );
88      }
89      else if( TrueAudio::File* trueaudio = dynamic_cast<TrueAudio::File*>(f.file()) )
90      {
This page took 0.041076 seconds and 3 git commands to generate.