mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset aa529bac2a92 (bug 996465)
This commit is contained in:
parent
9756dd6d1e
commit
81350142f1
@ -2162,9 +2162,6 @@ MediaDecoderStateMachine::SeekCompleted()
|
|||||||
// Try to decode another frame to detect if we're at the end...
|
// Try to decode another frame to detect if we're at the end...
|
||||||
DECODER_LOG(PR_LOG_DEBUG, "Seek completed, mCurrentFrameTime=%lld", mCurrentFrameTime);
|
DECODER_LOG(PR_LOG_DEBUG, "Seek completed, mCurrentFrameTime=%lld", mCurrentFrameTime);
|
||||||
|
|
||||||
// Prevent changes in playback position before 'seeked' is fired for we
|
|
||||||
// expect currentTime equals seek target in 'seeked' callback.
|
|
||||||
mScheduler->FreezeScheduling();
|
|
||||||
{
|
{
|
||||||
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
|
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
|
||||||
NS_DispatchToMainThread(stopEvent, NS_DISPATCH_SYNC);
|
NS_DispatchToMainThread(stopEvent, NS_DISPATCH_SYNC);
|
||||||
@ -2176,7 +2173,6 @@ MediaDecoderStateMachine::SeekCompleted()
|
|||||||
mQuickBuffering = false;
|
mQuickBuffering = false;
|
||||||
|
|
||||||
ScheduleStateMachine();
|
ScheduleStateMachine();
|
||||||
mScheduler->ThawScheduling();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Runnable to dispose of the decoder and state machine on the main thread.
|
// Runnable to dispose of the decoder and state machine on the main thread.
|
||||||
|
@ -94,15 +94,8 @@ MediaDecoderStateMachineScheduler::Schedule(int64_t aUsecs)
|
|||||||
{
|
{
|
||||||
mMonitor.AssertCurrentThreadIn();
|
mMonitor.AssertCurrentThreadIn();
|
||||||
|
|
||||||
switch(mState) {
|
if (mState == SCHEDULER_STATE_SHUTDOWN) {
|
||||||
case SCHEDULER_STATE_SHUTDOWN:
|
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
case SCHEDULER_STATE_FROZEN:
|
|
||||||
mState = SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK;
|
|
||||||
case SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK:
|
|
||||||
return NS_OK;
|
|
||||||
case SCHEDULER_STATE_NONE:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
aUsecs = std::max<int64_t>(aUsecs, 0);
|
aUsecs = std::max<int64_t>(aUsecs, 0);
|
||||||
@ -171,9 +164,6 @@ void
|
|||||||
MediaDecoderStateMachineScheduler::ScheduleAndShutdown()
|
MediaDecoderStateMachineScheduler::ScheduleAndShutdown()
|
||||||
{
|
{
|
||||||
mMonitor.AssertCurrentThreadIn();
|
mMonitor.AssertCurrentThreadIn();
|
||||||
if (IsFrozen()) {
|
|
||||||
ThawScheduling();
|
|
||||||
}
|
|
||||||
// Schedule next cycle to handle SHUTDOWN in state machine thread.
|
// Schedule next cycle to handle SHUTDOWN in state machine thread.
|
||||||
Schedule();
|
Schedule();
|
||||||
// This must be set after calling Schedule()
|
// This must be set after calling Schedule()
|
||||||
@ -204,33 +194,4 @@ MediaDecoderStateMachineScheduler::ResetTimer()
|
|||||||
mTimeout = TimeStamp();
|
mTimeout = TimeStamp();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaDecoderStateMachineScheduler::FreezeScheduling()
|
|
||||||
{
|
|
||||||
mMonitor.AssertCurrentThreadIn();
|
|
||||||
if (mState == SCHEDULER_STATE_SHUTDOWN) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MOZ_ASSERT(mState == SCHEDULER_STATE_NONE);
|
|
||||||
mState = !IsScheduled() ? SCHEDULER_STATE_FROZEN :
|
|
||||||
SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK;
|
|
||||||
// Nullify pending timer task if any.
|
|
||||||
++mTimerId;
|
|
||||||
mTimeout = TimeStamp();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MediaDecoderStateMachineScheduler::ThawScheduling()
|
|
||||||
{
|
|
||||||
mMonitor.AssertCurrentThreadIn();
|
|
||||||
if (mState == SCHEDULER_STATE_SHUTDOWN) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// We should be in frozen state and no pending timer task.
|
|
||||||
MOZ_ASSERT(IsFrozen() && !IsScheduled());
|
|
||||||
bool pendingTask = mState == SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK;
|
|
||||||
mState = SCHEDULER_STATE_NONE;
|
|
||||||
if (pendingTask) {
|
|
||||||
Schedule();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
@ -21,8 +21,6 @@ class ReentrantMonitor;
|
|||||||
class MediaDecoderStateMachineScheduler {
|
class MediaDecoderStateMachineScheduler {
|
||||||
enum State {
|
enum State {
|
||||||
SCHEDULER_STATE_NONE,
|
SCHEDULER_STATE_NONE,
|
||||||
SCHEDULER_STATE_FROZEN,
|
|
||||||
SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK,
|
|
||||||
SCHEDULER_STATE_SHUTDOWN
|
SCHEDULER_STATE_SHUTDOWN
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
@ -34,8 +32,6 @@ public:
|
|||||||
nsresult Schedule(int64_t aUsecs = 0);
|
nsresult Schedule(int64_t aUsecs = 0);
|
||||||
void ScheduleAndShutdown();
|
void ScheduleAndShutdown();
|
||||||
nsresult TimeoutExpired(int aTimerId);
|
nsresult TimeoutExpired(int aTimerId);
|
||||||
void FreezeScheduling();
|
|
||||||
void ThawScheduling();
|
|
||||||
|
|
||||||
bool OnStateMachineThread() const;
|
bool OnStateMachineThread() const;
|
||||||
bool IsScheduled() const;
|
bool IsScheduled() const;
|
||||||
@ -48,11 +44,6 @@ public:
|
|||||||
return mEventTarget;
|
return mEventTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFrozen() const {
|
|
||||||
return mState == SCHEDULER_STATE_FROZEN ||
|
|
||||||
mState == SCHEDULER_STATE_FROZEN_WITH_PENDING_TASK;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ResetTimer();
|
void ResetTimer();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user