зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1446346 If an AudioContext hasn't been started, do not bother clamping/jittering the CurrentTime r=padenot
This will resolve several intermittments that were occuring because we would occasionally get unlucky and have a jitter midpoint of 0, making an unstarted AudioContext report a CurrentTime of 100us (or 1ms - whatever our clamp value was.) MozReview-Commit-ID: 45zXLbB93wP --HG-- extra : rebase_source : 23ea5964dc49543c2b4ca45890c4c08456e75c73
This commit is contained in:
Родитель
7bd6a55b97
Коммит
1e46fe37dc
|
@ -667,6 +667,12 @@ double
|
||||||
AudioContext::CurrentTime()
|
AudioContext::CurrentTime()
|
||||||
{
|
{
|
||||||
MediaStream* stream = Destination()->Stream();
|
MediaStream* stream = Destination()->Stream();
|
||||||
|
|
||||||
|
if (!mIsStarted &&
|
||||||
|
stream->StreamTimeToSeconds(stream->GetCurrentTime()) == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// The value of a MediaStream's CurrentTime will always advance forward; it will never
|
// The value of a MediaStream's CurrentTime will always advance forward; it will never
|
||||||
// reset (even if one rewinds a video.) Therefore we can use a single Random Seed
|
// reset (even if one rewinds a video.) Therefore we can use a single Random Seed
|
||||||
// initialized at the same time as the object.
|
// initialized at the same time as the object.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче