Bug 569163 - Fix a race in nsWaveDecoder's ended state handling. r=cpearce a=roc
☠☠ backed out by f5865a11a278 ☠ ☠
authorMatthew Gregan <kinetik@flim.org>
Mon, 15 Nov 2010 11:41:22 +1300
changeset 57486 c1351e1799b8f0aa39c55263755367b452312217
parent 57485 98b0ae8881953f47aa601acbc7fa95ada11b0124
child 57487 8066a37cd0c95c06b109061c61794dc64d761446
child 57492 f5865a11a2786c853ea8deecbb98c28bce273fa7
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewerscpearce, roc
bugs569163
milestone2.0b8pre
Bug 569163 - Fix a race in nsWaveDecoder's ended state handling. r=cpearce a=roc
content/media/wave/nsWaveDecoder.cpp
--- a/content/media/wave/nsWaveDecoder.cpp
+++ b/content/media/wave/nsWaveDecoder.cpp
@@ -1452,16 +1452,17 @@ nsWaveDecoder::PlaybackEnded()
 {
   if (mShuttingDown) {
     return;
   }
 
   if (!mPlaybackStateMachine->IsEnded()) {
     return;
   }
+  mEnded = PR_TRUE;
 
   // Update ready state; now that we've finished playback, we should
   // switch to HAVE_CURRENT_DATA.
   UpdateReadyStateForData();
   if (mElement) {
     mElement->PlaybackEnded();
   }
 }
@@ -1507,19 +1508,16 @@ nsWaveDecoder::IsSeeking() const
     return mPlaybackStateMachine->IsSeeking();
   }
   return PR_FALSE;
 }
 
 PRBool
 nsWaveDecoder::IsEnded() const
 {
-  if (mPlaybackStateMachine) {
-    return mPlaybackStateMachine->IsEnded();
-  }
   return mEnded;
 }
 
 nsMediaDecoder::Statistics
 nsWaveDecoder::GetStatistics()
 {
   if (!mPlaybackStateMachine)
     return Statistics();