Bug 461286. Don't try to get more frames if we've completed decoding. r=roc
authorChris Double <chris.double@double.co.nz>
Tue, 19 May 2009 12:07:27 +1200
changeset 25630 302aaa904cf1caf6f71ce06cf7f59bbe49b0b500
parent 25629 28b9fc4fceaf741ddda5b4bdba9c31175d682e2d
child 25631 9de90ab4e41d58fc8122a83b851be909aa0e407d
push id1514
push userrocallahan@mozilla.com
push dateThu, 21 May 2009 04:04:17 +0000
reviewersroc
bugs461286
milestone1.9.1pre
Bug 461286. Don't try to get more frames if we've completed decoding. r=roc
content/media/video/src/nsOggDecoder.cpp
--- a/content/media/video/src/nsOggDecoder.cpp
+++ b/content/media/video/src/nsOggDecoder.cpp
@@ -1213,17 +1213,17 @@ nsresult nsOggDecodeStateMachine::Run()
           mBufferExhausted = PR_FALSE;
           mDecodingCompleted = PR_FALSE;
           nsCOMPtr<nsIRunnable> event = new nsOggStepDecodeEvent(this, mPlayer);
           mStepDecodeThread->Dispatch(event, NS_DISPATCH_NORMAL);
         }
 
         // Get the decoded frames and store them in our queue of decoded frames
         QueueDecodedFrames();
-        while (mDecodedFrames.IsEmpty()) {
+        while (mDecodedFrames.IsEmpty() && !mDecodingCompleted) {
           mon.Wait(PR_MillisecondsToInterval(PRInt64(mCallbackPeriod*500)));
           if (mState != DECODER_STATE_DECODING)
             break;
           QueueDecodedFrames();
         }
 
         if (mState != DECODER_STATE_DECODING)
           continue;