Backed out changeset b6bec74def09 (bug 1123535)

This commit is contained in:
Carsten "Tomcat" Book 2015-01-27 09:39:04 +01:00
parent 2e6ffad845
commit 5b1fad6c59

View File

@ -1967,7 +1967,7 @@ MediaDecoderStateMachine::EnsureAudioDecodeTaskQueued()
SAMPLE_LOG("EnsureAudioDecodeTaskQueued isDecoding=%d status=%d",
IsAudioDecoding(), mAudioRequestStatus);
if (mState >= DECODER_STATE_COMPLETED || mState == DECODER_STATE_DORMANT) {
if (mState >= DECODER_STATE_COMPLETED) {
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 || mState == DECODER_STATE_DORMANT) {
if (mState >= DECODER_STATE_COMPLETED) {
return NS_OK;
}
@ -2766,10 +2766,12 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
// Now that those threads are stopped, there's no possibility of
// mPendingWakeDecoder being needed again. Revoke it.
mPendingWakeDecoder = nullptr;
DebugOnly<nsresult> rv = DecodeTaskQueue()->Dispatch(
NS_NewRunnableMethod(mReader, &MediaDecoderReader::ReleaseMediaResources));
MOZ_ASSERT(NS_SUCCEEDED(rv));
{
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
// Wait for the thread decoding, if any, to exit.
DecodeTaskQueue()->AwaitIdle();
mReader->ReleaseMediaResources();
}
return NS_OK;
}