Bug 1136827 - Stop proxying DecodeError to the decode thread. r=mattwoodrow

At this point, all the callers actually call it on the state machine thread,
where it belongs.
This commit is contained in:
Bobby Holley 2015-03-23 16:15:54 -07:00
parent d5f5272884
commit 6aa248ee60
2 changed files with 2 additions and 24 deletions

View File

@ -930,13 +930,6 @@ MediaDecoderStateMachine::OnNotDecoded(MediaData::Type aType,
}
}
void
MediaDecoderStateMachine::AcquireMonitorAndInvokeDecodeError()
{
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
DecodeError();
}
void
MediaDecoderStateMachine::MaybeFinishDecodeFirstFrame()
{
@ -2096,25 +2089,13 @@ bool MediaDecoderStateMachine::HasLowUndecodedData(int64_t aUsecs)
void
MediaDecoderStateMachine::DecodeError()
{
AssertCurrentThreadInMonitor();
MOZ_ASSERT(OnStateMachineThread());
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (mState == DECODER_STATE_SHUTDOWN) {
// Already shutdown.
return;
}
// DecodeError should probably be redesigned so that it doesn't need to run
// on the Decode Task Queue, but this does the trick for now.
if (!OnDecodeThread()) {
RefPtr<nsIRunnable> task(
NS_NewRunnableMethod(this, &MediaDecoderStateMachine::AcquireMonitorAndInvokeDecodeError));
nsresult rv = DecodeTaskQueue()->Dispatch(task);
if (NS_FAILED(rv)) {
DECODER_WARN("Failed to dispatch AcquireMonitorAndInvokeDecodeError");
}
return;
}
// Change state to shutdown before sending error report to MediaDecoder
// and the HTMLMediaElement, so that our pipeline can start exiting
// cleanly during the sync dispatch below.

View File

@ -410,9 +410,6 @@ public:
// and aborting all pending operations on the decode task queue.
void Reset();
private:
void AcquireMonitorAndInvokeDecodeError();
protected:
virtual ~MediaDecoderStateMachine();