Bug 1127122 - Make ResourceQueue::Evict treat aSizeToEvict as relative to the start of the data instead of 0. r=cajbir,jya
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 29 Jan 2015 23:34:18 +1300
changeset 226494 1e5647b23d2eac3ef087c77b5de6a828c83a8217
parent 226493 3716775c5a2b908132bfcad59fe9b59346b970d5
child 226495 44fc5d2b4dfe5f95d0f3782b536086808324a872
push id54857
push usermwoodrow@mozilla.com
push dateThu, 29 Jan 2015 10:35:07 +0000
treeherdermozilla-inbound@1e5647b23d2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir, jya
bugs1127122
milestone38.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 1127122 - Make ResourceQueue::Evict treat aSizeToEvict as relative to the start of the data instead of 0. r=cajbir,jya
dom/media/mediasource/ResourceQueue.h
--- a/dom/media/mediasource/ResourceQueue.h
+++ b/dom/media/mediasource/ResourceQueue.h
@@ -103,17 +103,17 @@ public:
     Push(new ResourceItem(aData));
   }
 
   // Tries to evict at least aSizeToEvict from the queue up until
   // aOffset. Returns amount evicted.
   uint32_t Evict(uint64_t aOffset, uint32_t aSizeToEvict) {
     SBR_DEBUG("ResourceQueue(%p)::Evict(aOffset=%llu, aSizeToEvict=%u)",
               this, aOffset, aSizeToEvict);
-    return EvictBefore(std::min(aOffset, (uint64_t)aSizeToEvict));
+    return EvictBefore(std::min(aOffset, mOffset + (uint64_t)aSizeToEvict));
   }
 
   uint32_t EvictBefore(uint64_t aOffset) {
     SBR_DEBUG("ResourceQueue(%p)::EvictBefore(%llu)", this, aOffset);
     uint32_t evicted = 0;
     while (ResourceItem* item = ResourceAt(0)) {
       SBR_DEBUG("ResourceQueue(%p)::EvictBefore item=%p length=%d offset=%llu",
                 this, item, item->mData->Length(), mOffset);