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 249009 225fd7ea8fc6cb4e1f5e5f0fc21c43facfa4c419
parent 249008 a0954dd9d40ae52531631bba4116f7531175d60d
child 249010 de7cd37e48e8a718eff35ff63dfe1d7dd207ff3c
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersajones
bugs1119033
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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());