Bug 1132342: Handle race should operation be aborted while reading metadata. r=karlt a=lsblakk
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 24 Feb 2015 16:38:41 +1100
changeset 250343 803ed9fc9507
parent 250342 20306323469e
child 250344 aa133901be39
push id4554
push userrgiles@mozilla.com
push date2015-03-11 18:25 +0000
treeherdermozilla-beta@803ed9fc9507 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, lsblakk
bugs1132342
milestone37.0
Bug 1132342: Handle race should operation be aborted while reading metadata. r=karlt a=lsblakk
dom/media/mediasource/TrackBuffer.cpp
--- a/dom/media/mediasource/TrackBuffer.cpp
+++ b/dom/media/mediasource/TrackBuffer.cpp
@@ -634,16 +634,20 @@ TrackBuffer::InitializeDecoder(SourceBuf
   }
   // HACK END.
 
   reader->SetIdle();
   if (mShutdown) {
     MSE_DEBUG("was shut down while reading metadata. Aborting initialization.");
     return;
   }
+  if (mCurrentDecoder != aDecoder) {
+    MSE_DEBUG("append was cancelled. Aborting initialization.");
+    return;
+  }
 
   if (NS_SUCCEEDED(rv) && reader->IsWaitingOnCDMResource()) {
     mWaitingDecoders.AppendElement(aDecoder);
     return;
   }
 
   aDecoder->SetTaskQueue(nullptr);