Bug 1427666 - MediaCacheStream::InitAsCloneInternal() should notify the client that new data is available.
We should call ChannelMediaResource::CacheClientNotifyDataReceived() no matter
new data is coming from the channel or copied from the original cache stream
so the decoder has a chance to compute 'canplaythrough' and buffer ranges.
MozReview-Commit-ID: I4cLow2VzJg
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -2911,16 +2911,20 @@ MediaCacheStream::InitAsCloneInternal(Me
mResourceID = aOriginal->mResourceID;
// Grab cache blocks from aOriginal as readahead blocks for our stream
mStreamLength = aOriginal->mStreamLength;
mIsTransportSeekable = aOriginal->mIsTransportSeekable;
mDownloadStatistics = aOriginal->mDownloadStatistics;
mDownloadStatistics.Stop();
+ // Notify the client that we have new data so the decoder has a chance to
+ // compute 'canplaythrough' and buffer ranges.
+ mClient->CacheClientNotifyDataReceived();
+
if (aOriginal->mDidNotifyDataEnded &&
NS_SUCCEEDED(aOriginal->mNotifyDataEndedStatus)) {
mNotifyDataEndedStatus = aOriginal->mNotifyDataEndedStatus;
mDidNotifyDataEnded = true;
mClient->CacheClientNotifyDataEnded(mNotifyDataEndedStatus);
}
for (uint32_t i = 0; i < aOriginal->mBlocks.Length(); ++i) {