diff --git a/taglib/riff/aiff/aifffile.cpp b/taglib/riff/aiff/aifffile.cpp index 9bc5cd18..70040e8e 100644 --- a/taglib/riff/aiff/aifffile.cpp +++ b/taglib/riff/aiff/aifffile.cpp @@ -36,7 +36,8 @@ class RIFF::AIFF::File::FilePrivate public: FilePrivate() : properties(0), - tag(0) + tag(0), + tagChunkID("ID3 ") { } @@ -49,6 +50,7 @@ public: Properties *properties; ID3v2::Tag *tag; + ByteVector tagChunkID; }; //////////////////////////////////////////////////////////////////////////////// @@ -85,7 +87,7 @@ bool RIFF::AIFF::File::save() return false; } - setChunkData("ID3 ", d->tag->render()); + setChunkData(d->tagChunkID, d->tag->render()); return true; } @@ -97,8 +99,10 @@ bool RIFF::AIFF::File::save() void RIFF::AIFF::File::read(bool readProperties, Properties::ReadStyle propertiesStyle) { for(uint i = 0; i < chunkCount(); i++) { - if(chunkName(i) == "ID3 ") + if(chunkName(i) == "ID3 " || chunkName(i) == "id3 ") { + d->tagChunkID = chunkName(i); d->tag = new ID3v2::Tag(this, chunkOffset(i)); + } else if(chunkName(i) == "COMM" && readProperties) d->properties = new Properties(chunkData(i), propertiesStyle); } diff --git a/taglib/riff/wav/wavfile.cpp b/taglib/riff/wav/wavfile.cpp index f323a27d..c4e62fa3 100644 --- a/taglib/riff/wav/wavfile.cpp +++ b/taglib/riff/wav/wavfile.cpp @@ -36,7 +36,8 @@ class RIFF::WAV::File::FilePrivate public: FilePrivate() : properties(0), - tag(0) + tag(0), + tagChunkID("ID3 ") { } @@ -49,6 +50,7 @@ public: Properties *properties; ID3v2::Tag *tag; + ByteVector tagChunkID; }; //////////////////////////////////////////////////////////////////////////////// @@ -85,7 +87,7 @@ bool RIFF::WAV::File::save() return false; } - setChunkData("ID3 ", d->tag->render()); + setChunkData(d->tagChunkID, d->tag->render()); return true; } @@ -99,8 +101,10 @@ void RIFF::WAV::File::read(bool readProperties, Properties::ReadStyle properties ByteVector formatData; uint streamLength = 0; for(uint i = 0; i < chunkCount(); i++) { - if(chunkName(i) == "ID3 ") + if(chunkName(i) == "ID3 " || chunkName(i) == "id3 ") { + d->tagChunkID = chunkName(i); d->tag = new ID3v2::Tag(this, chunkOffset(i)); + } else if(chunkName(i) == "fmt " && readProperties) formatData = chunkData(i); else if(chunkName(i) == "data" && readProperties)