aboutsummaryrefslogtreecommitdiffstats
path: root/taglib/riff
diff options
context:
space:
mode:
authorTsuda Kageyu <tsuda.kageyu@gmail.com>2015-12-03 16:55:05 +0900
committerTsuda Kageyu <tsuda.kageyu@gmail.com>2015-12-03 16:55:05 +0900
commit52d3122e9e603419799a03dfee1df7a2dd4788ef (patch)
treed883b656f59d25756addc007f554764c3b23b321 /taglib/riff
parent24f220224d9ee3f4d49b338975031ed3dc759aed (diff)
Remove some unused private data members.
Diffstat (limited to 'taglib/riff')
-rw-r--r--taglib/riff/rifffile.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/taglib/riff/rifffile.cpp b/taglib/riff/rifffile.cpp
index b96d3db5..b1064cc1 100644
--- a/taglib/riff/rifffile.cpp
+++ b/taglib/riff/rifffile.cpp
@@ -51,10 +51,8 @@ public:
size(0) {}
const Endianness endianness;
- ByteVector type;
- unsigned int size;
- ByteVector format;
+ unsigned int size;
std::vector<Chunk> chunks;
};
@@ -177,8 +175,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo
// Couldn't find an existing chunk, so let's create a new one.
- unsigned int i = d->chunks.size() - 1;
- unsigned long offset = d->chunks[i].offset + d->chunks[i].size;
+ unsigned long offset = d->chunks.back().offset + d->chunks.back().size;
// First we update the global size
@@ -192,7 +189,7 @@ void RIFF::File::setChunkData(const ByteVector &name, const ByteVector &data, bo
// And update our internal structure
if(offset & 1) {
- d->chunks[i].padding = 1;
+ d->chunks.back().padding = 1;
offset++;
}
@@ -235,11 +232,13 @@ void RIFF::File::removeChunk(const ByteVector &name)
void RIFF::File::read()
{
- bool bigEndian = (d->endianness == BigEndian);
+ const bool bigEndian = (d->endianness == BigEndian);
+ const long baseOffset = tell();
- d->type = readBlock(4);
+ seek(baseOffset + 4);
d->size = readBlock(4).toUInt(bigEndian);
- d->format = readBlock(4);
+
+ seek(baseOffset + 12);
// + 8: chunk header at least, fix for additional junk bytes
while(tell() + 8 <= length()) {