Bug 1422657. P1 - GetStatistics() should pass mPlaybackPosition to mResource->GetCachedDataEnd(). r=bechen,gerald

Usually mDecoderPosition and mPlaybackPosition are in the same cached range so
GetCachedDataEnd(mDecoderPosition) and GetCachedDataEnd(mPlaybackPosition) will
give the same result.

It also makes more sense to pass the playback position instead of decoder
position since 'canplaythrough' is about playback instead of decoding.

MozReview-Commit-ID: Kk1uUeSFTCI

--HG--
extra : rebase_source : 354fe5b4a6fb73a477ded40bf5fb91979a2c2a8a
This commit is contained in:
JW Wang 2017-12-01 13:53:46 +08:00
Родитель 33546f8acf
Коммит 972cab9021
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -445,7 +445,7 @@ ChannelMediaDecoder::GetStatistics()
MediaStatistics result;
result.mDownloadRate =
mResource->GetDownloadRate(&result.mDownloadRateReliable);
result.mDownloadPosition = mResource->GetCachedDataEnd(mDecoderPosition);
result.mDownloadPosition = mResource->GetCachedDataEnd(mPlaybackPosition);
result.mTotalBytes = mResource->GetLength();
result.mPlaybackRate = mPlaybackBytesPerSecond;
result.mPlaybackRateReliable = mPlaybackRateReliable;