mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 886219 - Force an invalidation when an async video finishes. r=nical
This commit is contained in:
parent
7f8b1af70b
commit
9ad44524fe
@ -901,6 +901,7 @@ void MediaDecoder::PlaybackEnded()
|
||||
|
||||
PlaybackPositionChanged();
|
||||
ChangeState(PLAY_STATE_ENDED);
|
||||
InvalidateWithFlags(VideoFrameContainer::INVALIDATE_FORCE);
|
||||
|
||||
UpdateReadyStateForData();
|
||||
if (mOwner) {
|
||||
@ -1466,6 +1467,13 @@ ImageContainer* MediaDecoder::GetImageContainer()
|
||||
return mVideoFrameContainer ? mVideoFrameContainer->GetImageContainer() : nullptr;
|
||||
}
|
||||
|
||||
void MediaDecoder::InvalidateWithFlags(uint32_t aFlags)
|
||||
{
|
||||
if (mVideoFrameContainer) {
|
||||
mVideoFrameContainer->InvalidateWithFlags(aFlags);
|
||||
}
|
||||
}
|
||||
|
||||
void MediaDecoder::Invalidate()
|
||||
{
|
||||
if (mVideoFrameContainer) {
|
||||
|
@ -533,6 +533,7 @@ public:
|
||||
|
||||
// Invalidate the frame.
|
||||
void Invalidate();
|
||||
void InvalidateWithFlags(uint32_t aFlags);
|
||||
|
||||
// Suspend any media downloads that are in progress. Called by the
|
||||
// media element when it is sent to the bfcache, or when we need
|
||||
|
@ -106,11 +106,11 @@ double VideoFrameContainer::GetFrameDelay()
|
||||
return mPaintDelay.ToSeconds();
|
||||
}
|
||||
|
||||
void VideoFrameContainer::Invalidate()
|
||||
void VideoFrameContainer::InvalidateWithFlags(uint32_t aFlags)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Must call on main thread");
|
||||
|
||||
if (!mNeedInvalidation) {
|
||||
if (!mNeedInvalidation && !(aFlags & INVALIDATE_FORCE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,12 @@ public:
|
||||
// but was actually painted at t+n, this returns n in seconds. Threadsafe.
|
||||
double GetFrameDelay();
|
||||
// Call on main thread
|
||||
void Invalidate();
|
||||
enum {
|
||||
INVALIDATE_DEFAULT,
|
||||
INVALIDATE_FORCE
|
||||
};
|
||||
void Invalidate() { InvalidateWithFlags(INVALIDATE_DEFAULT); }
|
||||
void InvalidateWithFlags(uint32_t aFlags);
|
||||
ImageContainer* GetImageContainer();
|
||||
void ForgetElement() { mElement = nullptr; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user