зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1123535 - Run MediaDecoderReader::ReleaseMediaResources on decode task queue. r=jwwang
This commit is contained in:
Родитель
ead2712118
Коммит
6a682696a6
|
@ -1967,7 +1967,7 @@ MediaDecoderStateMachine::EnsureAudioDecodeTaskQueued()
|
|||
SAMPLE_LOG("EnsureAudioDecodeTaskQueued isDecoding=%d status=%d",
|
||||
IsAudioDecoding(), mAudioRequestStatus);
|
||||
|
||||
if (mState >= DECODER_STATE_COMPLETED) {
|
||||
if (mState >= DECODER_STATE_COMPLETED || mState == DECODER_STATE_DORMANT) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2012,7 +2012,7 @@ MediaDecoderStateMachine::EnsureVideoDecodeTaskQueued()
|
|||
NS_ASSERTION(OnStateMachineThread() || OnDecodeThread(),
|
||||
"Should be on state machine or decode thread.");
|
||||
|
||||
if (mState >= DECODER_STATE_COMPLETED) {
|
||||
if (mState >= DECODER_STATE_COMPLETED || mState == DECODER_STATE_DORMANT) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2766,12 +2766,9 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
|
|||
// Now that those threads are stopped, there's no possibility of
|
||||
// mPendingWakeDecoder being needed again. Revoke it.
|
||||
mPendingWakeDecoder = nullptr;
|
||||
{
|
||||
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
|
||||
// Wait for the thread decoding, if any, to exit.
|
||||
DecodeTaskQueue()->AwaitIdle();
|
||||
mReader->ReleaseMediaResources();
|
||||
}
|
||||
DebugOnly<nsresult> rv = DecodeTaskQueue()->Dispatch(
|
||||
NS_NewRunnableMethod(mReader, &MediaDecoderReader::ReleaseMediaResources));
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
mAudioRequestStatus = RequestStatus::Idle;
|
||||
mVideoRequestStatus = RequestStatus::Idle;
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче