View | Details | Raw Unified | Return to bug 276721 | Differences between
and this patch

Collapse All | Expand All

(-)b/multimedia/qmmp-qt6/files/patch-r11256 (+115 lines)
Added Link Here
1
--- src/plugins/Input/archive/archivetagreader.cpp
2
+++ src/plugins/Input/archive/archivetagreader.cpp
3
@@ -42,7 +42,11 @@
4
         return m_fileName.constData();
5
 #endif
6
     }
7
+#if TAGLIB_MAJOR_VERSION >= 2
8
+    virtual TagLib::ByteVector readBlock(size_t length) override
9
+#else
10
     virtual TagLib::ByteVector readBlock(unsigned long length) override
11
+#endif
12
     {
13
         char data[length];
14
         qint64 l = m_input->read(data, length);
15
@@ -55,10 +59,17 @@
16
     }
17
     virtual void writeBlock(const TagLib::ByteVector &) override
18
     {}
19
+#if TAGLIB_MAJOR_VERSION >= 2
20
+    virtual void insert(const TagLib::ByteVector &, TagLib::offset_t, size_t) override
21
+    {}
22
+    virtual void removeBlock(TagLib::offset_t, size_t) override
23
+    {}
24
+#else
25
     virtual void insert(const TagLib::ByteVector &, unsigned long, unsigned long) override
26
     {}
27
     virtual void removeBlock(unsigned long, unsigned long) override
28
     {}
29
+#endif
30
     virtual bool readOnly() const override
31
     {
32
         return true;
33
/trunk/qmmp/src/plugins/Input/flac/decoder_flac.cppDiffSwitch to side-by-side view
34
--- src/plugins/Input/flac/decoder_flac.cpp
35
+++ src/plugins/Input/flac/decoder_flac.cpp
36
@@ -295,7 +295,11 @@
37
             p.remove("flac://");
38
             p.remove(QRegularExpression("#\\d+$"));
39
             TagLib::FileStream stream(QStringToFileName(p), true);
40
+#if TAGLIB_MAJOR_VERSION >= 2
41
+            TagLib::FLAC::File fileRef(&stream);
42
+#else
43
             TagLib::FLAC::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance());
44
+#endif
45
             //looking for cuesheet comment
46
             TagLib::Ogg::XiphComment *tag = fileRef.xiphComment();
47
             TagLib::FLAC::Properties *ap = fileRef.audioProperties();
48
--- src/plugins/Input/flac/decoderflacfactory.cpp
49
+++ src/plugins/Input/flac/decoderflacfactory.cpp
50
@@ -97,7 +97,11 @@
51
 
52
     if(filePath.endsWith(".flac", Qt::CaseInsensitive))
53
     {
54
+#if TAGLIB_MAJOR_VERSION >= 2
55
+        flacFile = new TagLib::FLAC::File(&stream);
56
+#else
57
         flacFile = new TagLib::FLAC::File(&stream, TagLib::ID3v2::FrameFactory::instance());
58
+#endif
59
         tag = flacFile->xiphComment();
60
         ap = flacFile->audioProperties();
61
     }
62
--- src/plugins/Input/flac/flacmetadatamodel.cpp
63
+++ src/plugins/Input/flac/flacmetadatamodel.cpp
64
@@ -41,7 +41,11 @@
65
     if(m_path.endsWith(".flac", Qt::CaseInsensitive))
66
     {
67
         m_stream = new TagLib::FileStream(QStringToFileName(m_path), readOnly);
68
+#if TAGLIB_MAJOR_VERSION >= 2
69
+        TagLib::FLAC::File *f = new TagLib::FLAC::File(m_stream);
70
+#else
71
         TagLib::FLAC::File *f = new TagLib::FLAC::File(m_stream, TagLib::ID3v2::FrameFactory::instance());
72
+#endif
73
         m_tag = f->xiphComment();
74
         m_file = f;
75
         setDialogHints(dialogHints() | MetaDataModel::IsCueEditable);
76
--- src/plugins/Input/mpeg/decodermpegfactory.cpp
77
+++ src/plugins/Input/mpeg/decodermpegfactory.cpp
78
@@ -220,7 +220,11 @@
79
         return QList<TrackInfo*>() << info;
80
 
81
     TagLib::FileStream stream(QStringToFileName(path), true);
82
+#if TAGLIB_MAJOR_VERSION >= 2
83
+    TagLib::MPEG::File fileRef(&stream);
84
+#else
85
     TagLib::MPEG::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance());
86
+#endif
87
 
88
     if (parts & TrackInfo::MetaData)
89
     {
90
@@ -348,6 +352,11 @@
91
             break;
92
         case TagLib::MPEG::Header::Version2_5:
93
             info->setValue(Qmmp::FORMAT_NAME, QString("MPEG-2.5 layer %1").arg(fileRef.audioProperties()->layer()));
94
+            break;
95
+#if TAGLIB_MAJOR_VERSION >= 2
96
+        case TagLib::MPEG::Header::Version4:
97
+            info->setValue(Qmmp::FORMAT_NAME, QString("MPEG-4 layer %1").arg(fileRef.audioProperties()->layer()));
98
+#endif
99
         }
100
         info->setDuration(fileRef.audioProperties()->lengthInMilliseconds());
101
     }
102
--- src/plugins/Input/mpeg/mpegmetadatamodel.cpp
103
+++ src/plugins/Input/mpeg/mpegmetadatamodel.cpp
104
@@ -41,7 +41,11 @@
105
     MetaDataModel(readOnly, MetaDataModel::IsCoverEditable)
106
 {
107
     m_stream = new TagLib::FileStream(QStringToFileName(path), readOnly);
108
+#if TAGLIB_MAJOR_VERSION >= 2
109
+    m_file = new TagLib::MPEG::File(m_stream);
110
+#else
111
     m_file = new TagLib::MPEG::File(m_stream, TagLib::ID3v2::FrameFactory::instance());
112
+#endif
113
     m_tags << new MpegFileTagModel(using_rusxmms, m_file, TagLib::MPEG::File::ID3v1);
114
     m_tags << new MpegFileTagModel(using_rusxmms, m_file, TagLib::MPEG::File::ID3v2);
115
     m_tags << new MpegFileTagModel(using_rusxmms, m_file, TagLib::MPEG::File::APE);

Return to bug 276721