bool
DecodedAudioDataSink::WaitingForAudioToPlay()
{
  AssertOnAudioThread();
  // Return true if we're not playing, and we're not shutting down, or we're
  // playing and we've got no audio to play.
  if (!mStopAudioThread && (!mPlaying || ExpectMoreAudioData())) {
    return true;
  }
  return false;
}
Beispiel #2
0
void
AudioSink::WaitForAudioToPlay()
{
  // Wait while we're not playing, and we're not shutting down, or we're
  // playing and we've got no audio to play.
  AssertCurrentThreadInMonitor();
  while (!mStopAudioThread && (!mPlaying || ExpectMoreAudioData())) {
    if (!mPlaying && !mAudioStream->IsPaused()) {
      mAudioStream->Pause();
    }
    GetReentrantMonitor().Wait();
  }
}