Bug 1121841 - Clear the failed read after checking it. r=jya, a=sledru
authorBobby Holley <bobbyholley@gmail.com>
Thu, 15 Jan 2015 09:58:38 -0800
changeset 242893 0f43b4df53bb
parent 242892 66f61f3f9664
child 242894 b8922f819a88
push id4330
push userryanvm@gmail.com
push date2015-01-16 15:19 +0000
treeherdermozilla-beta@0b7d9ce1cdc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, sledru
bugs1121841
milestone36.0
Bug 1121841 - Clear the failed read after checking it. r=jya, a=sledru
dom/media/fmp4/MP4Reader.cpp
dom/media/fmp4/MP4Stream.h
--- a/dom/media/fmp4/MP4Reader.cpp
+++ b/dom/media/fmp4/MP4Reader.cpp
@@ -87,16 +87,17 @@ InvokeAndRetry(ThisType* aThisVal, Retur
     ReturnType result = ((*aThisVal).*aMethod)();
     if (result) {
       return result;
     }
     MP4Stream::ReadRecord failure(-1, 0);
     if (NS_WARN_IF(!stream->LastReadFailed(&failure))) {
       return result;
     }
+    stream->ClearFailedRead();
 
     if (NS_WARN_IF(failure == prevFailure)) {
       NS_WARNING(nsPrintfCString("Failed reading the same block twice: offset=%lld, count=%lu",
                                  failure.mOffset, failure.mCount).get());
       return result;
     }
 
     prevFailure = failure;
--- a/dom/media/fmp4/MP4Stream.h
+++ b/dom/media/fmp4/MP4Stream.h
@@ -40,16 +40,18 @@ public:
     if (mFailedRead.isSome()) {
       *aOut = mFailedRead.ref();
       return true;
     }
 
     return false;
   }
 
+  void ClearFailedRead() { mFailedRead.reset(); }
+
   void Pin()
   {
     mResource->Pin();
     ++mPinCount;
   }
 
   void Unpin()
   {