зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1385699. P4 - MediaDecoder::mExplicitDuration doesn't need to be a canonical anymore. r=cpearce
MozReview-Commit-ID: 4FUwQRS2K1m --HG-- extra : rebase_source : 66b2f1a9fcdf54abd61f071847c1469ad3a3c5c4 extra : source : 0da2d6137100d1cb3ec33d5ce735252eeba3ac62
This commit is contained in:
Родитель
1ab15ede36
Коммит
17554a637a
|
@ -380,7 +380,6 @@ MediaDecoder::MediaDecoder(MediaDecoderInit& aInit)
|
|||
, INIT_CANONICAL(mVolume, aInit.mVolume)
|
||||
, INIT_CANONICAL(mPreservesPitch, aInit.mPreservesPitch)
|
||||
, INIT_CANONICAL(mLooping, aInit.mLooping)
|
||||
, INIT_CANONICAL(mExplicitDuration, Maybe<double>())
|
||||
, INIT_CANONICAL(mPlayState, PLAY_STATE_LOADING)
|
||||
, INIT_CANONICAL(mLogicallySeeking, false)
|
||||
, INIT_CANONICAL(mSameOriginMedia, false)
|
||||
|
@ -1162,8 +1161,8 @@ MediaDecoder::DurationChanged()
|
|||
|
||||
// Use the explicit duration if we have one.
|
||||
// Otherwise use the duration mirrored from MDSM.
|
||||
if (mExplicitDuration.Ref().isSome()) {
|
||||
mDuration = mExplicitDuration.Ref().ref();
|
||||
if (mExplicitDuration.isSome()) {
|
||||
mDuration = mExplicitDuration.ref();
|
||||
} else if (mStateMachineDuration.Ref().isSome()) {
|
||||
mDuration = mStateMachineDuration.Ref().ref().ToSeconds();
|
||||
}
|
||||
|
@ -1179,9 +1178,8 @@ MediaDecoder::DurationChanged()
|
|||
|
||||
// See https://www.w3.org/Bugs/Public/show_bug.cgi?id=28822 for a discussion
|
||||
// of whether we should fire durationchange on explicit infinity.
|
||||
if (mFiredMetadataLoaded
|
||||
&& (!mozilla::IsInfinite<double>(mDuration)
|
||||
|| mExplicitDuration.Ref().isSome())) {
|
||||
if (mFiredMetadataLoaded &&
|
||||
(!mozilla::IsInfinite<double>(mDuration) || mExplicitDuration.isSome())) {
|
||||
GetOwner()->DispatchAsyncEvent(NS_LITERAL_STRING("durationchange"));
|
||||
}
|
||||
|
||||
|
|
|
@ -464,12 +464,12 @@ protected:
|
|||
// State-watching manager.
|
||||
WatchManager<MediaDecoder> mWatchManager;
|
||||
|
||||
double ExplicitDuration() { return mExplicitDuration.Ref().ref(); }
|
||||
double ExplicitDuration() { return mExplicitDuration.ref(); }
|
||||
|
||||
void SetExplicitDuration(double aValue)
|
||||
{
|
||||
MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
|
||||
mExplicitDuration.Set(Some(aValue));
|
||||
mExplicitDuration = Some(aValue);
|
||||
|
||||
// We Invoke DurationChanged explicitly, rather than using a watcher, so
|
||||
// that it takes effect immediately, rather than at the end of the current task.
|
||||
|
@ -714,7 +714,7 @@ protected:
|
|||
|
||||
// Media duration set explicitly by JS. At present, this is only ever present
|
||||
// for MSE.
|
||||
Canonical<Maybe<double>> mExplicitDuration;
|
||||
Maybe<double> mExplicitDuration;
|
||||
|
||||
// Set to one of the valid play states.
|
||||
// This can only be changed on the main thread while holding the decoder
|
||||
|
@ -768,10 +768,6 @@ public:
|
|||
{
|
||||
return &mLooping;
|
||||
}
|
||||
AbstractCanonical<Maybe<double>>* CanonicalExplicitDuration()
|
||||
{
|
||||
return &mExplicitDuration;
|
||||
}
|
||||
AbstractCanonical<PlayState>* CanonicalPlayState() { return &mPlayState; }
|
||||
AbstractCanonical<bool>* CanonicalLogicallySeeking()
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ MediaSourceDecoder::MediaSourceDecoder(MediaDecoderInit& aInit)
|
|||
, mMediaSource(nullptr)
|
||||
, mEnded(false)
|
||||
{
|
||||
mExplicitDuration.Set(Some(UnspecifiedNaN<double>()));
|
||||
mExplicitDuration.emplace(UnspecifiedNaN<double>());
|
||||
}
|
||||
|
||||
MediaDecoderStateMachine*
|
||||
|
|
Загрузка…
Ссылка в новой задаче