Make MDSM::StartBuffering happen on the state machine thread

This commit is contained in:
trav90
2016-09-27 11:43:25 -05:00
committed by roytam1
parent 90904cb897
commit 5155516c96
3 changed files with 12 additions and 6 deletions
+9 -3
View File
@@ -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.