Bug 861136 - Don't start buffering media state machine when we don't need to. r=roc

This commit is contained in:
Chris Pearce 2014-03-03 14:49:52 +13:00
parent f81fe641a7
commit dfdc0cfb5d

View File

@ -2448,6 +2448,15 @@ bool MediaDecoderStateMachine::JustExitedQuickBuffering()
void MediaDecoderStateMachine::StartBuffering()
{
AssertCurrentThreadInMonitor();
if (mState != DECODER_STATE_DECODING) {
// We only move into BUFFERING state if we're actually decoding.
// If we're currently doing something else, we don't need to buffer,
// and more importantly, we shouldn't overwrite mState to interrupt
// the current operation, as that could leave us in an inconsistent
// state!
return;
}
if (IsPlaying()) {
StopPlayback();