Merge "Restore feature parity with the old HTTPDataSource as far as support for extra headers (cookies?) and socket-timeout are concerned." into kraken
diff --git a/media/libstagefright/NuCachedSource2.cpp b/media/libstagefright/NuCachedSource2.cpp
index 63ba000..6727c73 100644
--- a/media/libstagefright/NuCachedSource2.cpp
+++ b/media/libstagefright/NuCachedSource2.cpp
@@ -416,7 +416,7 @@
             return mFinalStatus;
         }
 
-        size_t avail = mCache->totalSize() - offset;
+        size_t avail = mCache->totalSize() - delta;
         mCache->copy(delta, data, avail);
 
         return avail;