Bug 496581. If we seek to the end, enter COMPLETED state instead of trying to decode more. r=doublec

--HG--
extra : rebase_source : 16d4e604e40384221b148bf8939339179a93d96c
This commit is contained in:
Robert O'Callahan 2009-06-12 14:07:08 +12:00
parent 679ac11f8b
commit f600456032

View File

@ -1645,15 +1645,17 @@ nsresult nsOggDecodeStateMachine::Run()
// if we need to seek again.
LOG(PR_LOG_DEBUG, ("Changed state from SEEKING (to %f) to DECODING", seekTime));
mState = DECODER_STATE_DECODING;
mon.NotifyAll();
mon.Exit();
nsCOMPtr<nsIRunnable> stopEvent;
if (mDecodedFrames.GetCount() > 1) {
stopEvent = NS_NEW_RUNNABLE_METHOD(nsOggDecoder, mDecoder, SeekingStopped);
mState = DECODER_STATE_DECODING;
} else {
stopEvent = NS_NEW_RUNNABLE_METHOD(nsOggDecoder, mDecoder, SeekingStoppedAtEnd);
mState = DECODER_STATE_COMPLETED;
}
mon.NotifyAll();
mon.Exit();
NS_DispatchToMainThread(stopEvent, NS_DISPATCH_SYNC);
mon.Enter();
}