mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1145686 - Make MDSM::StartBuffering happen on the state machine thread. r=jww
This commit is contained in:
parent
f63bfb2b8b
commit
4843f048ee
@ -1497,9 +1497,8 @@ void MediaDecoder::Resume(bool aForceBuffering)
|
||||
mResource->Resume();
|
||||
}
|
||||
if (aForceBuffering) {
|
||||
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
|
||||
if (mDecoderStateMachine) {
|
||||
mDecoderStateMachine->StartBuffering();
|
||||
mDecoderStateMachine->DispatchStartBuffering();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3205,7 +3205,8 @@ bool MediaDecoderStateMachine::JustExitedQuickBuffering()
|
||||
|
||||
void MediaDecoderStateMachine::StartBuffering()
|
||||
{
|
||||
AssertCurrentThreadInMonitor();
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
|
||||
if (mState != DECODER_STATE_DECODING) {
|
||||
// We only move into BUFFERING state if we're actually decoding.
|
||||
|
@ -254,11 +254,17 @@ public:
|
||||
// the decode monitor held.
|
||||
void UpdatePlaybackPosition(int64_t aTime);
|
||||
|
||||
private:
|
||||
// Causes the state machine to switch to buffering state, and to
|
||||
// immediately stop playback and buffer downloaded data. Must be called
|
||||
// with the decode monitor held. Called on the state machine thread and
|
||||
// the main thread.
|
||||
// immediately stop playback and buffer downloaded data. Called on
|
||||
// the state machine thread.
|
||||
void StartBuffering();
|
||||
public:
|
||||
|
||||
void DispatchStartBuffering()
|
||||
{
|
||||
TaskQueue()->Dispatch(NS_NewRunnableMethod(this, &MediaDecoderStateMachine::StartBuffering));
|
||||
}
|
||||
|
||||
// This is called on the state machine thread and audio thread.
|
||||
// The decoder monitor must be obtained before calling this.
|
||||
|
Loading…
Reference in New Issue
Block a user