chapters/dvd: increase timestamp precision

matroska / xml can store more precise timestamps.
This commit is contained in:
Tom Yan 2021-02-03 22:10:12 +08:00 committed by Moritz Bunkus
parent 56ea93ab41
commit f8a5c1dbad
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85

View File

@ -93,14 +93,14 @@ parse_dvd(std::string const &file_name) {
cur_frames += ((dt->frame_u & 0x30) >> 4) * 10 + (dt->frame_u & 0x0f);
}
auto factor = fps == 30 ? 1001ull : 1000ull;
timestamps.emplace_back(timestamp_c::ms(factor * overall_frames / fps));
auto factor = fps == 30 ? 1001 : 1000;
timestamps.emplace_back(timestamp_c::ns(1000000ull * factor * overall_frames / fps));
overall_frames += cur_frames;
}
auto factor = fps == 30 ? 1001ull : 1000ull;
timestamps.emplace_back(timestamp_c::ms(factor * overall_frames / fps));
auto factor = fps == 30 ? 1001 : 1000;
timestamps.emplace_back(timestamp_c::ns(1000000ull * factor * overall_frames / fps));
}
return titles_and_timestamps;