зеркало из https://github.com/mozilla/gecko-dev.git
Bug 814308 - MediaDecoder::SetDuration doesn't handle aDuration=inf correctly. r=kinetik
This commit is contained in:
Родитель
fb545c5be5
Коммит
4be8e0040b
|
@ -23,6 +23,7 @@
|
|||
#include <cstdlib> // for std::abs(int/long)
|
||||
#include <cmath> // for std::abs(float/double)
|
||||
#include <algorithm>
|
||||
#include <mozilla/FloatingPoint.h>
|
||||
|
||||
#ifdef MOZ_WMF
|
||||
#include "WMFDecoder.h"
|
||||
|
@ -1189,7 +1190,14 @@ void MediaDecoder::DurationChanged()
|
|||
void MediaDecoder::SetDuration(double aDuration)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (MOZ_DOUBLE_IS_INFINITE(aDuration)) {
|
||||
SetInfinite(true);
|
||||
} else if (MOZ_DOUBLE_IS_NaN(aDuration)) {
|
||||
mDuration = -1;
|
||||
SetInfinite(true);
|
||||
} else {
|
||||
mDuration = static_cast<int64_t>(NS_round(aDuration * static_cast<double>(USECS_PER_S)));
|
||||
}
|
||||
|
||||
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
|
||||
if (mDecoderStateMachine) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче