From e0492337144b955c9f188366f5c0055960d4e70d Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 11 Nov 2014 20:50:20 -0800 Subject: [PATCH] Bug 1091008 - Make sure to always set mStartTime via SetStartTime. r=cpearce --- dom/media/MediaDecoderStateMachine.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index d80602eefdbb..bfdb9ab400ec 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -1296,12 +1296,11 @@ void MediaDecoderStateMachine::SetDuration(int64_t aDuration) return; } - if (mStartTime != -1) { - mEndTime = mStartTime + aDuration; - } else { - mStartTime = 0; - mEndTime = aDuration; + if (mStartTime == -1) { + SetStartTime(0); } + + mEndTime = mStartTime + aDuration; } void MediaDecoderStateMachine::UpdateEstimatedDuration(int64_t aDuration) @@ -3021,7 +3020,7 @@ MediaDecoderStateMachine::DropAudioUpToSeekTarget(AudioData* aSample) void MediaDecoderStateMachine::SetStartTime(int64_t aStartTimeUsecs) { - NS_ASSERTION(OnDecodeThread(), "Should be on decode thread."); + AssertCurrentThreadInMonitor(); DECODER_LOG("SetStartTime(%lld)", aStartTimeUsecs); mStartTime = 0; if (aStartTimeUsecs != 0) {