diff --git a/dom/media/MediaResource.cpp b/dom/media/MediaResource.cpp index 1954e2233e58..b54769f5168e 100644 --- a/dom/media/MediaResource.cpp +++ b/dom/media/MediaResource.cpp @@ -124,7 +124,7 @@ ChannelMediaResource::Listener::OnStartRequest(nsIRequest* aRequest, { if (!mResource) return NS_OK; - return mResource->OnStartRequest(aRequest); + return mResource->OnStartRequest(aRequest, mOffset); } nsresult @@ -190,7 +190,8 @@ IsPayloadCompressed(nsIHttpChannel* aChannel) } nsresult -ChannelMediaResource::OnStartRequest(nsIRequest* aRequest) +ChannelMediaResource::OnStartRequest(nsIRequest* aRequest, + int64_t aRequestOffset) { NS_ASSERTION(mChannel.get() == aRequest, "Wrong channel!"); @@ -288,7 +289,7 @@ ChannelMediaResource::OnStartRequest(nsIRequest* aRequest) mCacheStream.NotifyDataStarted(rangeStart); } acceptsRanges = gotRangeHeader; - } else if (GetOffset() > 0 && responseStatus == HTTP_OK_CODE) { + } else if (aRequestOffset > 0 && responseStatus == HTTP_OK_CODE) { // If we get an OK response but we were seeking, or requesting a byte // range, then we have to assume that seeking doesn't work. We also need // to tell the cache that it's getting data for the start of the stream. @@ -297,7 +298,7 @@ ChannelMediaResource::OnStartRequest(nsIRequest* aRequest) // The server claimed it supported range requests. It lied. acceptsRanges = false; } - if (GetOffset() == 0 && contentLength >= 0 && + if (aRequestOffset == 0 && contentLength >= 0 && (responseStatus == HTTP_OK_CODE || responseStatus == HTTP_PARTIAL_RESPONSE_CODE)) { mCacheStream.NotifyDataLength(contentLength); diff --git a/dom/media/MediaResource.h b/dom/media/MediaResource.h index a93825680ed5..ec6f6e814aca 100644 --- a/dom/media/MediaResource.h +++ b/dom/media/MediaResource.h @@ -533,7 +533,7 @@ public: protected: bool IsSuspendedByCache(); // These are called on the main thread by Listener. - nsresult OnStartRequest(nsIRequest* aRequest); + nsresult OnStartRequest(nsIRequest* aRequest, int64_t aRequestOffset); nsresult OnStopRequest(nsIRequest* aRequest, nsresult aStatus); nsresult OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream,