Bug 474393. Fix bytes-downloaded count. r=doublec
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 22 Jan 2009 22:35:27 +1300
changeset 24046 ed4a08325d3cd0d55556186e1bae27b91a6de99a
parent 24045 0dec4e077be27ec575b4fa1f509ddbd05fd200fe
child 24047 5ab96ef362ae174bb82300b53d0e1fe830c6aa68
push id4869
push userrocallahan@mozilla.com
push dateThu, 22 Jan 2009 09:36:26 +0000
treeherdermozilla-central@5ab96ef362ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdoublec
bugs474393
milestone1.9.2a1pre
Bug 474393. Fix bytes-downloaded count. r=doublec
content/media/video/src/nsChannelToPipeListener.cpp
--- a/content/media/video/src/nsChannelToPipeListener.cpp
+++ b/content/media/video/src/nsChannelToPipeListener.cpp
@@ -191,17 +191,18 @@ nsresult nsChannelToPipeListener::OnData
   
   do {
     nsresult rv = mOutput->WriteFrom(aStream, aCount, &bytes);
     if (NS_FAILED(rv))
       return rv;
     
     aCount -= bytes;
     mTotalBytes += bytes;
-    mDecoder->UpdateBytesDownloaded(mOffset + aOffset + bytes);
+    aOffset += bytes;
+    mDecoder->UpdateBytesDownloaded(mOffset + aOffset);
   } while (aCount) ;
   
   nsresult rv = mOutput->Flush();
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Fire a progress events according to the time and byte constraints outlined
   // in the spec.
   mDecoder->Progress(PR_FALSE);