зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1353607. P8 - use TimeUnit in DispatchSetFragmentEndTime(). r=kikuo
MozReview-Commit-ID: IBLT0j7yMLK --HG-- extra : rebase_source : a441e4f71c7286225deb3cc6719582b912549bd0 extra : intermediate-source : 2b7da6662a5a783e0cb9e574c5a8678c991aa306 extra : source : 0647d6d92deabbc38a22c5e681e71ce92fdd8267
This commit is contained in:
Родитель
a40ec389de
Коммит
88fd9831d4
|
@ -1432,7 +1432,7 @@ MediaDecoder::SetFragmentEndTime(double aTime)
|
|||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (mDecoderStateMachine) {
|
||||
mDecoderStateMachine->DispatchSetFragmentEndTime(
|
||||
static_cast<int64_t>(aTime * USECS_PER_S));
|
||||
media::TimeUnit::FromSeconds(aTime));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -189,15 +189,14 @@ public:
|
|||
|
||||
RefPtr<ShutdownPromise> BeginShutdown();
|
||||
|
||||
// Set the media fragment end time. aEndTime is in microseconds.
|
||||
void DispatchSetFragmentEndTime(int64_t aEndTime)
|
||||
// Set the media fragment end time.
|
||||
void DispatchSetFragmentEndTime(const media::TimeUnit& aEndTime)
|
||||
{
|
||||
RefPtr<MediaDecoderStateMachine> self = this;
|
||||
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([self, aEndTime] () {
|
||||
// A negative number means we don't have a fragment end time at all.
|
||||
self->mFragmentEndTime = aEndTime >= 0
|
||||
? media::TimeUnit::FromMicroseconds(aEndTime)
|
||||
: media::TimeUnit::Invalid();
|
||||
self->mFragmentEndTime = aEndTime >= media::TimeUnit::Zero()
|
||||
? aEndTime : media::TimeUnit::Invalid();
|
||||
});
|
||||
OwnerThread()->Dispatch(r.forget());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче