Bug 806754. Part 2: Fix bogus assertions. r=cpearce

SendStreamAudio gets called by SendStreamData which can be called
on the state machine thread since bug 794426 was fixed.
At the same time PlayFromAudioQueuec can no longer guarantee that
mAudioCaptured is false. It could be true and we're waiting for
the audio thread to shut down. We can just remove that assertion;
the logic in SendStreamData guarantees that we don't try to pass
audio to MediaStreams until the audio thread has actually stopped.
This commit is contained in:
Robert O'Callahan
2013-01-30 17:20:03 +13:00
parent a217511baa
commit 2bc33bc440
3 changed files with 49 additions and 3 deletions

View File

@@ -506,7 +506,8 @@ void MediaDecoderStateMachine::SendStreamAudio(AudioData* aAudio,
DecodedStreamData* aStream,
AudioSegment* aOutput)
{
NS_ASSERTION(OnDecodeThread(), "Should be on decode thread.");
NS_ASSERTION(OnDecodeThread() ||
OnStateMachineThread(), "Should be on decode thread or state machine thread");
mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
if (aAudio->mTime <= aStream->mLastAudioPacketTime) {
@@ -1210,7 +1211,7 @@ uint32_t MediaDecoderStateMachine::PlaySilence(uint32_t aFrames,
}
uint32_t MediaDecoderStateMachine::PlayFromAudioQueue(uint64_t aFrameOffset,
uint32_t aChannels)
uint32_t aChannels)
{
NS_ASSERTION(OnAudioThread(), "Only call on audio thread.");
NS_ASSERTION(!mAudioStream->IsPaused(), "Don't play when paused");
@@ -1218,7 +1219,6 @@ uint32_t MediaDecoderStateMachine::PlayFromAudioQueue(uint64_t aFrameOffset,
{
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
NS_WARN_IF_FALSE(IsPlaying(), "Should be playing");
NS_ASSERTION(!mAudioCaptured, "Audio cannot be captured here!");
// Awaken the decode loop if it's waiting for space to free up in the
// audio queue.
mDecoder->GetReentrantMonitor().NotifyAll();