mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1204430. Part 1 - dispatch AbstractMediaDecoder::SetMediaSeekable() to the main thread. r=kinetik.
This commit is contained in:
parent
a12546643f
commit
7d3c2064f3
@ -93,6 +93,13 @@ public:
|
|||||||
// Set the media as being seekable or not.
|
// Set the media as being seekable or not.
|
||||||
virtual void SetMediaSeekable(bool aMediaSeekable) = 0;
|
virtual void SetMediaSeekable(bool aMediaSeekable) = 0;
|
||||||
|
|
||||||
|
void DispatchSetMediaSeekable(bool aMediaSeekable)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethodWithArg<bool>(
|
||||||
|
this, &AbstractMediaDecoder::SetMediaSeekable, aMediaSeekable);
|
||||||
|
NS_DispatchToMainThread(r);
|
||||||
|
}
|
||||||
|
|
||||||
virtual VideoFrameContainer* GetVideoFrameContainer() = 0;
|
virtual VideoFrameContainer* GetVideoFrameContainer() = 0;
|
||||||
virtual mozilla::layers::ImageContainer* GetImageContainer() = 0;
|
virtual mozilla::layers::ImageContainer* GetImageContainer() = 0;
|
||||||
|
|
||||||
|
@ -1110,6 +1110,7 @@ void MediaDecoder::UpdateEstimatedMediaDuration(int64_t aDuration)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MediaDecoder::SetMediaSeekable(bool aMediaSeekable) {
|
void MediaDecoder::SetMediaSeekable(bool aMediaSeekable) {
|
||||||
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
|
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
|
||||||
mMediaSeekable = aMediaSeekable;
|
mMediaSeekable = aMediaSeekable;
|
||||||
}
|
}
|
||||||
|
@ -1932,7 +1932,7 @@ MediaDecoderStateMachine::OnMetadataRead(MetadataHolder* aMetadata)
|
|||||||
|
|
||||||
// Set mode to PLAYBACK after reading metadata.
|
// Set mode to PLAYBACK after reading metadata.
|
||||||
mResource->SetReadMode(MediaCacheStream::MODE_PLAYBACK);
|
mResource->SetReadMode(MediaCacheStream::MODE_PLAYBACK);
|
||||||
mDecoder->SetMediaSeekable(mReader->IsMediaSeekable());
|
mDecoder->DispatchSetMediaSeekable(mReader->IsMediaSeekable());
|
||||||
mInfo = aMetadata->mInfo;
|
mInfo = aMetadata->mInfo;
|
||||||
mMetadataTags = aMetadata->mTags.forget();
|
mMetadataTags = aMetadata->mTags.forget();
|
||||||
nsRefPtr<MediaDecoderStateMachine> self = this;
|
nsRefPtr<MediaDecoderStateMachine> self = this;
|
||||||
|
@ -720,10 +720,7 @@ void OggReader::SetChained(bool aIsChained) {
|
|||||||
ReentrantMonitorAutoEnter mon(mMonitor);
|
ReentrantMonitorAutoEnter mon(mMonitor);
|
||||||
mIsChained = aIsChained;
|
mIsChained = aIsChained;
|
||||||
}
|
}
|
||||||
{
|
mDecoder->DispatchSetMediaSeekable(false);
|
||||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
|
||||||
mDecoder->SetMediaSeekable(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OggReader::ReadOggChain()
|
bool OggReader::ReadOggChain()
|
||||||
|
Loading…
Reference in New Issue
Block a user