Bug 1308078. Part 1 - Don't decode metadata again when exiting the dormant state. r=kaku

MozReview-Commit-ID: JBzxcePE8F8

--HG--
extra : rebase_source : 8bc1c642a66adec57b38741132d5005f40e46cbd
extra : source : 55ef6ec6353b69cdc88240ce4c953a61054816df
This commit is contained in:
JW Wang 2016-10-06 14:57:29 +08:00
Родитель cfcd2ba433
Коммит 5e39aa3292
1 изменённых файлов: 10 добавлений и 8 удалений

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

@ -291,12 +291,6 @@ private:
{
mMetadataRequest.Complete();
if (mPendingDormant) {
// No need to store mQueuedSeek because we are at position 0.
SetState(DECODER_STATE_DORMANT);
return;
}
// Set mode to PLAYBACK after reading metadata.
Resource()->SetReadMode(MediaCacheStream::MODE_PLAYBACK);
@ -343,6 +337,12 @@ private:
mMaster->EnqueueLoadedMetadataEvent();
}
if (mPendingDormant) {
// No need to store mQueuedSeek because we are at position 0.
SetState(DECODER_STATE_DORMANT);
return;
}
if (waitingForCDM) {
// Metadata parsing was successful but we're still waiting for CDM caps
// to become available so that we can build the correct decryptor/decoder.
@ -417,8 +417,10 @@ public:
bool HandleDormant(bool aDormant) override
{
if (!aDormant) {
// Exit dormant state.
SetState(DECODER_STATE_DECODING_METADATA);
// Exit dormant state. Check if we need the CDMProxy to start decoding.
SetState(Info().IsEncrypted() && !mMaster->mCDMProxy
? DECODER_STATE_WAIT_FOR_CDM
: DECODER_STATE_DECODING_FIRSTFRAME);
}
return true;
}