Correctly handle non-integral bit depths

This commit is contained in:
Stephen F. Booth 2012-01-30 22:31:15 -05:00
parent d904281c6b
commit 7b3f279294

View File

@ -125,5 +125,5 @@ void RIFF::WAV::Properties::read(const ByteVector &data)
d->length = byteRate > 0 ? d->streamLength / byteRate : 0;
if(d->channels > 0 && d->sampleWidth > 0)
d->sampleFrames = d->streamLength / (d->channels * (d->sampleWidth / 8));
d->sampleFrames = d->streamLength / (d->channels * ((d->sampleWidth + 7) / 8));
}