mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1171311: P11. Only perform fuzz search on the interval's start. r=mattwoodrow a=kwierso
This commit is contained in:
parent
3533b2f179
commit
97fc04bbf8
@ -129,6 +129,11 @@ public:
|
||||
return mStart <= aX && aX < mEnd;
|
||||
}
|
||||
|
||||
bool ContainsWithStrictEnd(const T& aX) const
|
||||
{
|
||||
return mStart - mFuzz <= aX && aX < mEnd;
|
||||
}
|
||||
|
||||
bool Contains(const SelfType& aOther) const
|
||||
{
|
||||
return (mStart - mFuzz <= aOther.mStart + aOther.mFuzz) &&
|
||||
@ -140,6 +145,12 @@ public:
|
||||
return mStart <= aOther.mStart && aOther.mEnd <= mEnd;
|
||||
}
|
||||
|
||||
bool ContainsWithStrictEnd(const SelfType& aOther) const
|
||||
{
|
||||
return (mStart - mFuzz <= aOther.mStart + aOther.mFuzz) &&
|
||||
aOther.mEnd <= mEnd;
|
||||
}
|
||||
|
||||
bool Intersects(const SelfType& aOther) const
|
||||
{
|
||||
return (mStart - mFuzz < aOther.mEnd + aOther.mFuzz) &&
|
||||
@ -560,6 +571,15 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ContainsWithStrictEnd(const T& aX) const {
|
||||
for (const auto& interval : mIntervals) {
|
||||
if (interval.ContainsWithStrictEnd(aX)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Shift all values by aOffset.
|
||||
SelfType& Shift(const T& aOffset)
|
||||
{
|
||||
|
@ -400,7 +400,7 @@ MediaSourceTrackDemuxer::GetSample(DemuxerFailureReason& aFailure)
|
||||
// First demux, get first sample time.
|
||||
mNextSampleTime = ranges.GetStart();
|
||||
}
|
||||
if (!ranges.Contains(mNextSampleTime)) {
|
||||
if (!ranges.ContainsWithStrictEnd(mNextSampleTime)) {
|
||||
aFailure = DemuxerFailureReason::WAITING_FOR_DATA;
|
||||
return nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user