From eac2102182b2a8d9fa94e61b3ff62911254f3397 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Tue, 14 Feb 2012 21:48:16 +1300 Subject: [PATCH] Bug 673698 - Don't update video playback position during seek. r=roc --- content/media/nsBuiltinDecoder.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/content/media/nsBuiltinDecoder.cpp b/content/media/nsBuiltinDecoder.cpp index bddaa876429..17e69284364 100644 --- a/content/media/nsBuiltinDecoder.cpp +++ b/content/media/nsBuiltinDecoder.cpp @@ -865,7 +865,16 @@ void nsBuiltinDecoder::PlaybackPositionChanged() { ReentrantMonitorAutoEnter mon(mReentrantMonitor); if (mDecoderStateMachine) { - mCurrentTime = mDecoderStateMachine->GetCurrentTime(); + if (!IsSeeking()) { + // Only update the current playback position if we're not seeking. + // If we are seeking, the update could have been scheduled on the + // state machine thread while we were playing but after the seek + // algorithm set the current playback position on the main thread, + // and we don't want to override the seek algorithm and change the + // current time after the seek has started but before it has + // completed. + mCurrentTime = mDecoderStateMachine->GetCurrentTime(); + } mDecoderStateMachine->ClearPositionChangeFlag(); } }