Bug 1427666 - MediaCacheStream::InitAsCloneInternal() should notify the client that new data is available. r=bechen,gerald

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

--HG--
extra : rebase_source : ede936c94a6d728cf6c596863e45aa45d2617d45
This commit is contained in:
JW Wang 2018-01-03 10:33:11 +08:00
parent 3cb530e5ea
commit 240c0a0c9a

View File

@ -2916,6 +2916,10 @@ MediaCacheStream::InitAsCloneInternal(MediaCacheStream* aOriginal)
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;