Fixed an MP4 AudioProperties parsing error (#892)

The 'unit' (timescale) of 'mdhd' v1 atoms is a 32-bit unsigned integer (4 bytes long), but is parsed as a 64-bit integer (8 bytes long). This also affects the byte offset of the 'length' (duration).  This results in MP4 AudioProperties reporting a track length of zero.

This change addresses both problems.

See:
https://wiki.multimedia.cx/index.php/QuickTime_container
This commit is contained in:
Tim Malseed 2019-03-16 23:59:13 +11:00 committed by Stephen F. Booth
parent 96a4d896ba
commit 02090f335d

View File

@ -195,8 +195,8 @@ MP4::AudioProperties::read(File *file, Atoms *atoms)
debug("MP4: Atom 'trak.mdia.mdhd' is smaller than expected");
return;
}
unit = data.toInt64BE(28);
length = data.toInt64BE(36);
unit = data.toUInt32BE(28);
length = data.toInt64BE(32);
}
else {
if(data.size() < 24 + 4) {