зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1422677. P1 - move the call to ComputePlaybackRate() out of UpdatePlaybackRate(). r=bechen,gerald
We want to remove the side effect of ComputePlaybackRate(). Anyone who wants the side effect (updating mPlaybackBytesPerSecond/mPlaybackRateReliable) should call it explicitly. MozReview-Commit-ID: 8oHvCl5pewz --HG-- extra : rebase_source : 3ee54ea32d2d2d7185d9a65c6658a3e700f1fb71
This commit is contained in:
Родитель
834586be68
Коммит
d2f91da2bd
|
@ -274,6 +274,7 @@ ChannelMediaDecoder::NotifyDownloadEnded(nsresult aStatus)
|
|||
|
||||
MediaDecoderOwner* owner = GetOwner();
|
||||
if (NS_SUCCEEDED(aStatus) || aStatus == NS_BASE_STREAM_CLOSED) {
|
||||
ComputePlaybackRate();
|
||||
UpdatePlaybackRate();
|
||||
owner->DownloadSuspended();
|
||||
// NotifySuspendedStatusChanged will tell the element that download
|
||||
|
@ -339,6 +340,7 @@ ChannelMediaDecoder::DurationChanged()
|
|||
AbstractThread::AutoEnter context(AbstractMainThread());
|
||||
MediaDecoder::DurationChanged();
|
||||
// Duration has changed so we should recompute playback rate
|
||||
ComputePlaybackRate();
|
||||
UpdatePlaybackRate();
|
||||
}
|
||||
|
||||
|
@ -349,6 +351,7 @@ ChannelMediaDecoder::DownloadProgressed()
|
|||
MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
|
||||
AbstractThread::AutoEnter context(AbstractMainThread());
|
||||
GetOwner()->DownloadProgressed();
|
||||
ComputePlaybackRate();
|
||||
UpdatePlaybackRate();
|
||||
mResource->ThrottleReadahead(ShouldThrottleDownload());
|
||||
}
|
||||
|
@ -377,7 +380,6 @@ ChannelMediaDecoder::UpdatePlaybackRate()
|
|||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(mResource);
|
||||
|
||||
ComputePlaybackRate();
|
||||
uint32_t rate = mPlaybackBytesPerSecond;
|
||||
|
||||
if (mPlaybackRateReliable) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче