Consistent rounding when calculating the MP4 audio length.

This commit is contained in:
Tsuda Kageyu
2015-11-19 18:24:20 +09:00
parent f310b1810d
commit 1cc3e4cc57
2 changed files with 2 additions and 2 deletions

View File

@ -187,7 +187,7 @@ MP4::Properties::read(File *file, Atoms *atoms)
length = data.toUInt(24U);
}
if(unit > 0 && length > 0)
d->length = static_cast<int>(length * 1000.0 / unit);
d->length = static_cast<int>(length * 1000.0 / unit + 0.5);
MP4::Atom *atom = trak->find("mdia", "minf", "stbl", "stsd");
if(!atom) {