Bug 557432 - Commit backout.
authorChris Pearce <chris@pearce.org.nz>
Fri, 09 Apr 2010 16:33:54 +1200
changeset 40620 5022d0baf80c3f7a64e36940e0e2f6e86910e13d
parent 40618 0c2460ae7df7b4c57a5301b262992cbaf7bb52e9 (current diff)
parent 40619 49d669800db9502b01933c3f2e5d258abe8752a4 (diff)
child 40621 eb3112856e95240bed736e79bbc6f78cbbe4652a
push idunknown
push userunknown
push dateunknown
bugs557432
milestone1.9.3a5pre
Bug 557432 - Commit backout.
--- a/content/media/ogg/nsOggPlayStateMachine.cpp
+++ b/content/media/ogg/nsOggPlayStateMachine.cpp
@@ -928,18 +928,18 @@ nsresult nsOggPlayStateMachine::Run()
         // Play the remaining media.
         while (mState == DECODER_STATE_COMPLETED &&
                (mReader->mVideoQueue.GetSize() > 0 ||
                 (HasAudio() && !mAudioCompleted)))
         {
           AdvanceFrame();
         }
 
-        if (HasAudio()) {
-          // Close the audio stream so that next time audio is used a new stream
+        if (mAudioStream) {
+          // Close the audop stream so that next time audio is used a new stream
           // is created. The StopPlayback call also resets the IsPlaying() state
           // so audio is restarted correctly.
           StopPlayback(AUDIO_SHUTDOWN);
         }
 
         if (mState != DECODER_STATE_COMPLETED)
           continue;
 
@@ -1120,26 +1120,19 @@ void nsOggPlayStateMachine::RenderVideoF
     mDecoder->SetVideoData(data.mYSize, mInfo.mAspectRatio, image);
   }
 }
 
 PRInt64
 nsOggPlayStateMachine::GetAudioClock()
 {
   NS_ASSERTION(IsThread(mDecoder->mStateMachineThread), "Should be on state machine thread.");
-  if (!HasAudio())
+  if (!mAudioStream || !HasAudio())
     return -1;
-  PRInt64 t;
-  {
-    MonitorAutoExit exitMon(mDecoder->GetMonitor());
-    MonitorAutoEnter audioMon(mAudioMonitor);
-    if (!mAudioStream)
-      return -1;
-    t = mAudioStream->GetPosition();
-  }
+  PRInt64 t = mAudioStream->GetPosition();
   return (t == -1) ? -1 : t + mAudioStartTime;
 }
 
 void nsOggPlayStateMachine::AdvanceFrame()
 {
   NS_ASSERTION(IsThread(mDecoder->mStateMachineThread), "Should be on state machine thread.");
   mDecoder->GetMonitor().AssertCurrentThreadIn();