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.
|
||||
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 mozilla::layers::ImageContainer* GetImageContainer() = 0;
|
||||
|
||||
|
@ -1110,6 +1110,7 @@ void MediaDecoder::UpdateEstimatedMediaDuration(int64_t aDuration)
|
||||
}
|
||||
|
||||
void MediaDecoder::SetMediaSeekable(bool aMediaSeekable) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
|
||||
mMediaSeekable = aMediaSeekable;
|
||||
}
|
||||
|
@ -1932,7 +1932,7 @@ MediaDecoderStateMachine::OnMetadataRead(MetadataHolder* aMetadata)
|
||||
|
||||
// Set mode to PLAYBACK after reading metadata.
|
||||
mResource->SetReadMode(MediaCacheStream::MODE_PLAYBACK);
|
||||
mDecoder->SetMediaSeekable(mReader->IsMediaSeekable());
|
||||
mDecoder->DispatchSetMediaSeekable(mReader->IsMediaSeekable());
|
||||
mInfo = aMetadata->mInfo;
|
||||
mMetadataTags = aMetadata->mTags.forget();
|
||||
nsRefPtr<MediaDecoderStateMachine> self = this;
|
||||
|
@ -720,10 +720,7 @@ void OggReader::SetChained(bool aIsChained) {
|
||||
ReentrantMonitorAutoEnter mon(mMonitor);
|
||||
mIsChained = aIsChained;
|
||||
}
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
mDecoder->SetMediaSeekable(false);
|
||||
}
|
||||
mDecoder->DispatchSetMediaSeekable(false);
|
||||
}
|
||||
|
||||
bool OggReader::ReadOggChain()
|
||||
|
Loading…
Reference in New Issue
Block a user