mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1207198: P2. Defer dormant request while ReadMetadata is pending in MDSM. r=sotaro
This commit is contained in:
parent
e7316ae5cf
commit
90071cc1a9
@ -1246,6 +1246,18 @@ MediaDecoderStateMachine::SetDormant(bool aDormant)
|
||||
return;
|
||||
}
|
||||
|
||||
if (mMetadataRequest.Exists()) {
|
||||
if (mPendingDormant && mPendingDormant.ref() != aDormant && !aDormant) {
|
||||
// We already have a dormant request pending; the new request would have
|
||||
// resumed from dormant, we can just cancel any pending dormant requests.
|
||||
mPendingDormant.reset();
|
||||
} else {
|
||||
mPendingDormant = Some(aDormant);
|
||||
}
|
||||
return;
|
||||
}
|
||||
mPendingDormant.reset();
|
||||
|
||||
DECODER_LOG("SetDormant=%d", aDormant);
|
||||
|
||||
if (aDormant) {
|
||||
@ -1906,6 +1918,11 @@ MediaDecoderStateMachine::OnMetadataRead(MetadataHolder* aMetadata)
|
||||
MOZ_ASSERT(mState == DECODER_STATE_DECODING_METADATA);
|
||||
mMetadataRequest.Complete();
|
||||
|
||||
if (mPendingDormant) {
|
||||
SetDormant(mPendingDormant.ref());
|
||||
return;
|
||||
}
|
||||
|
||||
// Set mode to PLAYBACK after reading metadata.
|
||||
mResource->SetReadMode(MediaCacheStream::MODE_PLAYBACK);
|
||||
mDecoder->DispatchSetMediaSeekable(mReader->IsMediaSeekable());
|
||||
|
@ -1086,6 +1086,9 @@ private:
|
||||
// been written to the MediaStream.
|
||||
Watchable<bool> mAudioCompleted;
|
||||
|
||||
// Set if MDSM receives dormant request during reading metadata.
|
||||
Maybe<bool> mPendingDormant;
|
||||
|
||||
// Flag whether we notify metadata before decoding the first frame or after.
|
||||
//
|
||||
// Note that the odd semantics here are designed to replicate the current
|
||||
|
Loading…
Reference in New Issue
Block a user