зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1127203 - Use the tolerance value in TrackBuffersContainTime so that seeking operates with tolerance too. r=mattwoodrow
This commit is contained in:
Родитель
9acf6dac10
Коммит
dfc8573cd8
|
@ -642,10 +642,10 @@ bool
|
|||
MediaSourceReader::TrackBuffersContainTime(int64_t aTime)
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
if (mAudioTrack && !mAudioTrack->ContainsTime(aTime)) {
|
||||
if (mAudioTrack && !mAudioTrack->ContainsTime(aTime, EOS_FUZZ_US)) {
|
||||
return false;
|
||||
}
|
||||
if (mVideoTrack && !mVideoTrack->ContainsTime(aTime)) {
|
||||
if (mVideoTrack && !mVideoTrack->ContainsTime(aTime, EOS_FUZZ_US)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -584,13 +584,14 @@ TrackBuffer::IsReady()
|
|||
}
|
||||
|
||||
bool
|
||||
TrackBuffer::ContainsTime(int64_t aTime)
|
||||
TrackBuffer::ContainsTime(int64_t aTime, int64_t aTolerance)
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mParentDecoder->GetReentrantMonitor());
|
||||
for (uint32_t i = 0; i < mInitializedDecoders.Length(); ++i) {
|
||||
nsRefPtr<dom::TimeRanges> r = new dom::TimeRanges();
|
||||
mInitializedDecoders[i]->GetBuffered(r);
|
||||
if (r->Find(double(aTime) / USECS_PER_S) != dom::TimeRanges::NoIndex) {
|
||||
if (r->Find(double(aTime) / USECS_PER_S,
|
||||
double(aTolerance) / USECS_PER_S) != dom::TimeRanges::NoIndex) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
|
||||
// Returns true if any of the decoders managed by this track buffer
|
||||
// contain aTime in their buffered ranges.
|
||||
bool ContainsTime(int64_t aTime);
|
||||
bool ContainsTime(int64_t aTime, int64_t aTolerance);
|
||||
|
||||
void BreakCycles();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче