Bug 1540748 - part2 : add warning for negative adjusted time. r=jolin

As the purpose of adjusting time is to make the start of the playback to align to zero, so the result should not be negative.

However, we can't always ensure the demuxed start time is correct, the decoded first frame sample time might be different with the time demuxer provides.

Even if we try to update the start time when we get the first decoded sample, there is still a problem because a decoder might return samples with different order, which means the first frame the decoder returns is probably not a real first frame.

Therefore, using warning to help us knows how many this situaion would be.

Differential Revision: https://phabricator.services.mozilla.com/D28432

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alastor Wu 2019-04-26 22:30:06 +00:00
Родитель 285ab3ee11
Коммит 31a6a91d20
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -300,6 +300,9 @@ class MediaData {
// the result is invalid.
virtual bool AdjustForStartTime(const media::TimeUnit& aStartTime) {
mTime -= aStartTime;
if (mTime.IsNegative()) {
NS_WARNING("Negative start time after time-adjustment!");
}
return mTime.IsValid();
}