ByteVector::toUInt() takes offset and length

This commit is contained in:
Tsuda kageyu
2013-04-18 18:36:19 +09:00
parent c9209cc99e
commit 439f27640a
31 changed files with 254 additions and 159 deletions

View File

@ -133,16 +133,16 @@ void TrueAudio::Properties::read()
// Skip the audio format
pos += 2;
d->channels = d->data.mid(pos, 2).toShort(false);
d->channels = d->data.toShort(pos, false);
pos += 2;
d->bitsPerSample = d->data.mid(pos, 2).toShort(false);
d->bitsPerSample = d->data.toShort(pos, false);
pos += 2;
d->sampleRate = d->data.mid(pos, 4).toUInt(false);
d->sampleRate = d->data.toUInt(pos, false);
pos += 4;
d->sampleFrames = d->data.mid(pos, 4).toUInt(false);
d->sampleFrames = d->data.toUInt(pos, false);
d->length = d->sampleRate > 0 ? d->sampleFrames / d->sampleRate : 0;
d->bitrate = d->length > 0 ? ((d->streamLength * 8L) / d->length) / 1000 : 0;