Bug 518659. When deciding whether a previous stream is going to load the data we need, we need to check against the data we'll be loading next, not the data we're currently loading. r=doublec
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 18 Nov 2009 13:38:16 +1300
changeset 34960 8548c0ac4a934c2ce67c0a9729b3d1eeaf6d4d60
parent 34959 2d8cf8c2c699f41ee93a533ffbdd501b09007c91
child 34961 8456ce23a1ece2718110ef0de4dbb48088fe515b
push id10381
push userrocallahan@mozilla.com
push dateWed, 18 Nov 2009 00:40:45 +0000
treeherdermozilla-central@163fd6aa31df [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdoublec
bugs518659
milestone1.9.3a1pre
Bug 518659. When deciding whether a previous stream is going to load the data we need, we need to check against the data we'll be loading next, not the data we're currently loading. r=doublec
content/media/nsMediaCache.cpp
--- a/content/media/nsMediaCache.cpp
+++ b/content/media/nsMediaCache.cpp
@@ -1191,17 +1191,17 @@ nsMediaCache::Update()
         enableReading = predictedNewDataUse < latestNextUse;
       }
 
       if (enableReading) {
         for (PRUint32 j = 0; j < i; ++j) {
           nsMediaCacheStream* other = mStreams[j];
           if (other->mResourceID == stream->mResourceID &&
               !other->mCacheSuspended &&
-              other->mChannelOffset/BLOCK_SIZE == stream->mChannelOffset/BLOCK_SIZE) {
+              other->mChannelOffset/BLOCK_SIZE == desiredOffset/BLOCK_SIZE) {
             // This block is already going to be read by the other stream.
             // So don't try to read it from this stream as well.
             enableReading = PR_FALSE;
             break;
           }
         }
       }