Add support to estimate file duration.

The code will estimate the file duration if the last block duration is
0. This is not totally correct, but better then what we currently have.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1100

Change-Id: I8f81df0bd592e6f7b1925fa2637a2e09cf182742
This commit is contained in:
Frank Galligan
2016-10-13 12:57:54 -07:00
parent c97e3e7d60
commit 02bc809f9d
5 changed files with 75 additions and 3 deletions

View File

@@ -51,6 +51,7 @@ bool CompareFiles(const std::string& file1, const std::string& file2) {
const std::size_t r1 = std::fread(buf1, 1, kBlockSize, f1.get());
const std::size_t r2 = std::fread(buf2, 1, kBlockSize, f2.get());
// TODO(fgalligan): Add output of which byte differs.
if (r1 != r2 || std::memcmp(buf1, buf2, r1)) {
return 0; // Files are not equal
}
@@ -211,4 +212,4 @@ bool ParseMkvFile(const std::string& webm_file) {
return result;
}
} // namespace test
} // namespace test