mirror of
https://github.com/taglib/taglib.git
synced 2025-07-19 21:44:24 -04:00
Ignore 'fact' chunk of WAV files if their format is PCM.
TagLib reports wrong length of some PCM files with a 'fact' chunk.
This commit is contained in:
@ -192,7 +192,7 @@ void RIFF::WAV::Properties::read(File *file)
|
||||
d->sampleRate = data.toUInt(4, false);
|
||||
d->bitsPerSample = data.toShort(14, false);
|
||||
|
||||
if(totalSamples > 0)
|
||||
if(d->format != FORMAT_PCM)
|
||||
d->sampleFrames = totalSamples;
|
||||
else if(d->channels > 0 && d->bitsPerSample > 0)
|
||||
d->sampleFrames = streamLength / (d->channels * ((d->bitsPerSample + 7) / 8));
|
||||
|
Reference in New Issue
Block a user