Commit 69e26539 authored by Benjamin Chen's avatar Benjamin Chen
Browse files

Bug 1186752 - Remove ScheduleStateMachine() in MediaDecoder.cpp since we have...

Bug 1186752 - Remove ScheduleStateMachine() in MediaDecoder.cpp since we have state mirror. r=jwwang
parent 081f00cd
Loading
Loading
Loading
Loading
+2 −17
Original line number Diff line number Diff line
@@ -540,7 +540,7 @@ nsresult MediaDecoder::InitializeStateMachine(MediaDecoder* aCloneDonor)
  // set them now
  SetStateMachineParameters();

  return ScheduleStateMachine();
  return NS_OK;
}

void MediaDecoder::SetStateMachineParameters()
@@ -562,19 +562,6 @@ void MediaDecoder::SetMinimizePrerollUntilPlaybackStarts()
  MOZ_DIAGNOSTIC_ASSERT(!mDecoderStateMachine);
}

nsresult MediaDecoder::ScheduleStateMachine()
{
  MOZ_ASSERT(NS_IsMainThread());
  if (mShuttingDown)
    return NS_OK;

  MOZ_ASSERT(mDecoderStateMachine);
  NS_ENSURE_STATE(mDecoderStateMachine);
  ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
  mDecoderStateMachine->ScheduleStateMachineCrossThread();
  return NS_OK;
}

nsresult MediaDecoder::Play()
{
  MOZ_ASSERT(NS_IsMainThread());
@@ -585,7 +572,7 @@ nsresult MediaDecoder::Play()
  if (mPausedForPlaybackRateNull) {
    return NS_OK;
  }
  ScheduleStateMachine();

  if (IsEnded()) {
    return Seek(0, SeekTarget::PrevSyncPoint);
  } else if (mPlayState == PLAY_STATE_LOADING) {
@@ -1047,8 +1034,6 @@ void MediaDecoder::ChangeState(PlayState aState)
    RemoveMediaTracks();
  }

  ScheduleStateMachine();

  CancelDormantTimer();
  // Start dormant timer if necessary
  StartDormantTimer();
+0 −4
Original line number Diff line number Diff line
@@ -724,10 +724,6 @@ public:
  static bool IsAppleMP3Enabled();
#endif

  // Schedules the state machine to run one cycle on the shared state
  // machine thread. Main thread only.
  nsresult ScheduleStateMachine();

  struct Statistics {
    // Estimate of the current playback rate (bytes/second).
    double mPlaybackRate;
+1 −1
Original line number Diff line number Diff line
@@ -1042,7 +1042,7 @@ nsresult MediaDecoderStateMachine::Init(MediaDecoderStateMachine* aCloneDonor)

  nsresult rv = mReader->Init(cloneReader);
  NS_ENSURE_SUCCESS(rv, rv);

  ScheduleStateMachineCrossThread();
  return NS_OK;
}

+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ MediaSourceDecoder::Load(nsIStreamListener**, MediaDecoder*)
  NS_ENSURE_SUCCESS(rv, rv);

  SetStateMachineParameters();
  return ScheduleStateMachine();
  return NS_OK;
}

media::TimeIntervals