Backed out changeset 0b71e08f9d34 (bug 1109431) for mochitest-2 bustage on a CLOSED TREE

This commit is contained in:
Wes Kocher 2014-12-10 15:52:47 -08:00
Родитель ebbb8e2385
Коммит dc80961c63
5 изменённых файлов: 12 добавлений и 23 удалений

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

@ -98,7 +98,7 @@ TimeRanges::GetEndTime()
}
void
TimeRanges::Normalize(double aError)
TimeRanges::Normalize()
{
if (mRanges.Length() >= 2) {
nsAutoTArray<TimeRange,4> normalized;
@ -112,7 +112,7 @@ TimeRanges::Normalize(double aError)
current.mEnd >= mRanges[i].mEnd) {
continue;
}
if (current.mEnd + aError >= mRanges[i].mStart) {
if (current.mEnd >= mRanges[i].mStart) {
current.mEnd = mRanges[i].mEnd;
} else {
normalized.AppendElement(current);
@ -127,10 +127,10 @@ TimeRanges::Normalize(double aError)
}
void
TimeRanges::Union(const TimeRanges* aOtherRanges, double aError)
TimeRanges::Union(const TimeRanges* aOtherRanges)
{
mRanges.AppendElements(aOtherRanges->mRanges);
Normalize(aError);
Normalize();
}
void

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

@ -42,10 +42,10 @@ public:
double GetEndTime();
// See http://www.whatwg.org/html/#normalized-timeranges-object
void Normalize(double aError = 0.0);
void Normalize();
// Mutate this TimeRange to be the union of this and aOtherRanges.
void Union(const TimeRanges* aOtherRanges, double aError);
void Union(const TimeRanges* aOtherRanges);
// Mutate this TimeRange to be the intersection of this and aOtherRanges.
void Intersection(const TimeRanges* aOtherRanges);

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

@ -63,14 +63,6 @@ ContainerParser::TimestampsFuzzyEqual(int64_t aLhs, int64_t aRhs)
{
NS_WARNING("Using default ContainerParser::TimestampFuzzyEquals implementation");
return aLhs == aRhs;
return llabs(aLhs - aRhs) <= GetRoundingError();
}
int64_t
ContainerParser::GetRoundingError()
{
NS_WARNING("Using default ContainerParser::GetRoundingError implementation");
return 0;
}
const nsTArray<uint8_t>&
@ -87,7 +79,6 @@ public:
{}
static const unsigned NS_PER_USEC = 1000;
static const unsigned USEC_PER_SEC = 1000000;
bool IsInitSegmentPresent(const uint8_t* aData, uint32_t aLength)
{
@ -191,10 +182,10 @@ public:
return true;
}
int64_t GetRoundingError()
bool TimestampsFuzzyEqual(int64_t aLhs, int64_t aRhs)
{
int64_t error = mParser.GetTimecodeScale() / NS_PER_USEC;
return error * 2;
return llabs(aLhs - aRhs) <= error * 2;
}
private:
@ -285,9 +276,9 @@ public:
return true;
}
int64_t GetRoundingError()
bool TimestampsFuzzyEqual(int64_t aLhs, int64_t aRhs)
{
return 1000;
return llabs(aLhs - aRhs) <= 1000;
}
private:

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

@ -35,9 +35,7 @@ public:
// Compare aLhs and rHs, considering any error that may exist in the
// timestamps from the format's base representation. Return true if aLhs
// == aRhs within the error epsilon.
bool TimestampsFuzzyEqual(int64_t aLhs, int64_t aRhs);
virtual int64_t GetRoundingError();
virtual bool TimestampsFuzzyEqual(int64_t aLhs, int64_t aRhs);
const nsTArray<uint8_t>& InitData();

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

@ -316,7 +316,7 @@ TrackBuffer::Buffered(dom::TimeRanges* aRanges)
mDecoders[i]->GetBuffered(r);
if (r->Length() > 0) {
highestEndTime = std::max(highestEndTime, r->GetEndTime());
aRanges->Union(r, double(mParser->GetRoundingError()) / USECS_PER_S);
aRanges->Union(r);
}
}