test: fix fake clock for muxer for integration tests (#1322)
The fix in #1289 was not complete and left the fake clock as null which didn't have any effect. This was revealed by integration tests showing mismatches in the timestamps in MP4.
This commit is contained in:
parent
5d44368478
commit
9b9adf38ff
|
@ -692,10 +692,7 @@ uint64_t MP4Muxer::IsoTimeNow() {
|
||||||
const uint64_t kIsomTimeOffset = 2082844800l;
|
const uint64_t kIsomTimeOffset = 2082844800l;
|
||||||
|
|
||||||
// Get the current system time since January 1, 1970, in seconds.
|
// Get the current system time since January 1, 1970, in seconds.
|
||||||
std::chrono::system_clock::duration duration =
|
std::int64_t secondsSince1970 = Now();
|
||||||
std::chrono::system_clock::now().time_since_epoch();
|
|
||||||
std::int64_t secondsSince1970 =
|
|
||||||
std::chrono::duration_cast<std::chrono::seconds>(duration).count();
|
|
||||||
|
|
||||||
// Add the offset of seconds between January 1, 1970, and January 1, 1904.
|
// Add the offset of seconds between January 1, 1970, and January 1, 1904.
|
||||||
return secondsSince1970 + kIsomTimeOffset;
|
return secondsSince1970 + kIsomTimeOffset;
|
||||||
|
|
|
@ -942,6 +942,7 @@ Status Packager::Initialize(
|
||||||
|
|
||||||
media::MuxerFactory muxer_factory(packaging_params);
|
media::MuxerFactory muxer_factory(packaging_params);
|
||||||
if (packaging_params.test_params.inject_fake_clock) {
|
if (packaging_params.test_params.inject_fake_clock) {
|
||||||
|
internal->fake_clock.reset(new media::FakeClock());
|
||||||
muxer_factory.OverrideClock(internal->fake_clock);
|
muxer_factory.OverrideClock(internal->fake_clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue