зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1000608 - Populate active source buffers and fix/rename ContainsTime - r=kinetik
This commit is contained in:
Родитель
c28a3456df
Коммит
62d3a81cef
|
@ -175,6 +175,7 @@ MediaSource::AddSourceBuffer(const nsAString& aType, ErrorResult& aRv)
|
|||
return nullptr;
|
||||
}
|
||||
mSourceBuffers->Append(sourceBuffer);
|
||||
mActiveSourceBuffers->Append(sourceBuffer);
|
||||
MSE_DEBUG("%p AddSourceBuffer(Type=%s) -> %p", this,
|
||||
NS_ConvertUTF16toUTF8(mimeType).get(), sourceBuffer.get());
|
||||
return sourceBuffer.forget();
|
||||
|
|
|
@ -422,7 +422,7 @@ MediaSourceReader::Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
|
|||
ResetDecode();
|
||||
|
||||
dom::SourceBufferList* sbl = mMediaSource->ActiveSourceBuffers();
|
||||
if (sbl->ContainsTime (aTime / USECS_PER_S)) {
|
||||
if (sbl->AllContainsTime (aTime / USECS_PER_S)) {
|
||||
if (GetAudioReader()) {
|
||||
nsresult rv = GetAudioReader()->Seek(aTime, aStartTime, aEndTime, aCurrentTime);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
|
|
@ -112,14 +112,14 @@ SourceBufferList::Evict(double aStart, double aEnd)
|
|||
}
|
||||
|
||||
bool
|
||||
SourceBufferList::ContainsTime(double aTime)
|
||||
SourceBufferList::AllContainsTime(double aTime)
|
||||
{
|
||||
for (uint32_t i = 0; i < mSourceBuffers.Length(); ++i) {
|
||||
if (!mSourceBuffers[i]->ContainsTime(aTime)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return mSourceBuffers.Length() > 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
void Evict(double aStart, double aEnd);
|
||||
|
||||
// Returns true if all SourceBuffers in the list contain data for the given time.
|
||||
bool ContainsTime(double aTime);
|
||||
bool AllContainsTime(double aTime);
|
||||
|
||||
private:
|
||||
friend class AsyncEventRunner<SourceBufferList>;
|
||||
|
|
Загрузка…
Ссылка в новой задаче