mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1178437 - Dispatch SetFragmentEndTime. r=jww
This commit is contained in:
parent
6a5325c7f8
commit
90a2ee4218
@ -1153,8 +1153,7 @@ void MediaDecoder::SetFragmentEndTime(double aTime)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (mDecoderStateMachine) {
|
||||
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
|
||||
mDecoderStateMachine->SetFragmentEndTime(static_cast<int64_t>(aTime * USECS_PER_S));
|
||||
mDecoderStateMachine->DispatchSetFragmentEndTime(static_cast<int64_t>(aTime * USECS_PER_S));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1426,13 +1426,6 @@ void MediaDecoderStateMachine::RecomputeDuration()
|
||||
mDuration = Some(duration);
|
||||
}
|
||||
|
||||
void MediaDecoderStateMachine::SetFragmentEndTime(int64_t aEndTime)
|
||||
{
|
||||
AssertCurrentThreadInMonitor();
|
||||
|
||||
mFragmentEndTime = aEndTime < 0 ? aEndTime : aEndTime;
|
||||
}
|
||||
|
||||
bool MediaDecoderStateMachine::IsDormantNeeded()
|
||||
{
|
||||
return mReader->IsDormantNeeded();
|
||||
|
@ -306,7 +306,14 @@ public:
|
||||
void NotReached() { MOZ_DIAGNOSTIC_ASSERT(false); }
|
||||
|
||||
// Set the media fragment end time. aEndTime is in microseconds.
|
||||
void SetFragmentEndTime(int64_t aEndTime);
|
||||
void DispatchSetFragmentEndTime(int64_t aEndTime)
|
||||
{
|
||||
nsRefPtr<MediaDecoderStateMachine> self = this;
|
||||
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([self, aEndTime] () {
|
||||
self->mFragmentEndTime = aEndTime;
|
||||
});
|
||||
TaskQueue()->Dispatch(r.forget());
|
||||
}
|
||||
|
||||
// Drop reference to decoder. Only called during shutdown dance.
|
||||
void BreakCycles() {
|
||||
|
Loading…
Reference in New Issue
Block a user