mirror of
https://github.com/taglib/taglib.git
synced 2025-06-03 00:58:12 -04:00
Skip duplicate chunks when reading AIFF/WAV files.
Similar to #492. There is no good reason to use the last chunk rather than the first one.
This commit is contained in:
parent
4129b919c1
commit
9da20a8a52
@ -150,8 +150,14 @@ void RIFF::AIFF::File::read(bool readProperties, Properties::ReadStyle propertie
|
||||
debug("RIFF::AIFF::File::read() - Duplicate ID3v2 tag found.");
|
||||
}
|
||||
}
|
||||
else if(name == "COMM" && readProperties)
|
||||
formatData = chunkData(i);
|
||||
else if(name == "COMM" && readProperties) {
|
||||
if(formatData.isEmpty()) {
|
||||
formatData = chunkData(i);
|
||||
}
|
||||
else {
|
||||
debug("RIFF::AIFF::File::read() - Duplicate 'COMM' chunk found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!d->tag)
|
||||
|
@ -217,10 +217,22 @@ void RIFF::WAV::File::read(bool readProperties, Properties::ReadStyle properties
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(name == "fmt " && readProperties)
|
||||
formatData = chunkData(i);
|
||||
else if(name == "data" && readProperties)
|
||||
streamLength = chunkDataSize(i);
|
||||
else if(name == "fmt " && readProperties) {
|
||||
if(formatData.isEmpty()) {
|
||||
formatData = chunkData(i);
|
||||
}
|
||||
else {
|
||||
debug("RIFF::WAV::File::read() - Duplicate 'fmt ' chunk found.");
|
||||
}
|
||||
}
|
||||
else if(name == "data" && readProperties) {
|
||||
if(streamLength == 0) {
|
||||
streamLength = chunkDataSize(i);
|
||||
}
|
||||
else {
|
||||
debug("RIFF::WAV::File::read() - Duplicate 'data' chunk found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!d->tag[ID3v2Index])
|
||||
|
Loading…
x
Reference in New Issue
Block a user