Bug 881512 - Delay decoder initialization by indicating that we're waiting for subdecoders to be created. r=cajbir

This commit is contained in:
Matthew Gregan 2014-04-22 23:58:00 +12:00
Родитель 07984b60a6
Коммит 99fd9c18f5
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -55,6 +55,11 @@ public:
return NS_OK;
}
bool IsWaitingMediaResources() MOZ_OVERRIDE
{
return mDecoders.IsEmpty() && mPendingDecoders.IsEmpty();
}
bool DecodeAudioData() MOZ_OVERRIDE
{
if (mActiveAudioReader == -1) {
@ -355,6 +360,7 @@ MediaSourceReader::CallDecoderInitialization()
}
}
mPendingDecoders.Clear();
mDecoder->NotifyWaitingForResourcesStatusChanged();
mon.NotifyAll();
}
@ -383,6 +389,7 @@ MediaSourceReader::CreateSubDecoder(const nsACString& aType, MediaSourceDecoder*
decoder->SetReader(reader.forget());
mPendingDecoders.AppendElement(decoder);
EnqueueDecoderInitialization();
mDecoder->NotifyWaitingForResourcesStatusChanged();
return decoder.forget();
}