Bug 836143 - MediaDecoder should call its own OnDecodeThread for clearer error detection r=cpearce

This commit is contained in:
Steve Workman 2013-01-30 12:14:43 -08:00
Родитель 23cb9e5f40
Коммит 02bab68299
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -654,8 +654,7 @@ void MediaDecoder::QueueMetadata(int64_t aPublishTime,
bool aHasAudio,
MetadataTags* aTags)
{
NS_ASSERTION(mDecoderStateMachine->OnDecodeThread(),
"Should be on decode thread.");
NS_ASSERTION(OnDecodeThread(), "Should be on decode thread.");
GetReentrantMonitor().AssertCurrentThreadIn();
mDecoderStateMachine->QueueMetadata(aPublishTime, aChannels, aRate, aHasAudio, aTags);
}
@ -998,7 +997,7 @@ void MediaDecoder::NotifyBytesConsumed(int64_t aBytes)
{
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
NS_ENSURE_TRUE_VOID(mDecoderStateMachine);
MOZ_ASSERT(OnStateMachineThread() || mDecoderStateMachine->OnDecodeThread());
MOZ_ASSERT(OnStateMachineThread() || OnDecodeThread());
if (!mIgnoreProgressData) {
mDecoderPosition += aBytes;
mPlaybackStatistics.AddBytes(aBytes);
@ -1406,6 +1405,7 @@ void MediaDecoder::SetPreservesPitch(bool aPreservesPitch)
}
bool MediaDecoder::OnDecodeThread() const {
NS_WARN_IF_FALSE(mDecoderStateMachine, "mDecoderStateMachine is null");
return mDecoderStateMachine ? mDecoderStateMachine->OnDecodeThread() : false;
}