Bug 1119033 - Don't try to evict when we don't have any initialized decoders. r=ajones
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 12 Jan 2015 15:35:35 +1300
changeset 223241 225fd7ea8fc6cb4e1f5e5f0fc21c43facfa4c419
parent 223240 a0954dd9d40ae52531631bba4116f7531175d60d
child 223242 de7cd37e48e8a718eff35ff63dfe1d7dd207ff3c
push id10769
push usercbook@mozilla.com
push dateMon, 12 Jan 2015 14:15:52 +0000
treeherderfx-team@0e9765732906 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersajones
bugs1119033
milestone37.0a1
Bug 1119033 - Don't try to evict when we don't have any initialized decoders. r=ajones
dom/media/mediasource/TrackBuffer.cpp
--- a/dom/media/mediasource/TrackBuffer.cpp
+++ b/dom/media/mediasource/TrackBuffer.cpp
@@ -246,17 +246,17 @@ TrackBuffer::EvictData(uint32_t aThresho
   ReentrantMonitorAutoEnter mon(mParentDecoder->GetReentrantMonitor());
 
   int64_t totalSize = 0;
   for (uint32_t i = 0; i < mDecoders.Length(); ++i) {
     totalSize += mDecoders[i]->GetResource()->GetSize();
   }
 
   int64_t toEvict = totalSize - aThreshold;
-  if (toEvict <= 0) {
+  if (toEvict <= 0 || mInitializedDecoders.IsEmpty()) {
     return false;
   }
 
   // Get a list of initialized decoders, sorted by their start times.
   nsTArray<SourceBufferDecoder*> decoders;
   decoders.AppendElements(mInitializedDecoders);
   decoders.Sort(DecoderSorter());