Closed Bug 1015025 Opened 7 years ago Closed 7 years ago

MediaStreamGraph clock drift from rounding iteration deltas to MediaTime

Categories

(Core :: Web Audio, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: karlt, Assigned: karlt)

Details

Attachments

(1 file)

SecondsToMediaTime() rounds down to the nearest MediaTime.  Using this to
rounding the advance for each MediaTime iteration, but using unrounded values
for mCurrentTimeStamp means that up to 1/(1 << 20) seconds can be lost every
0.010 seconds.  That is up to 1 frame of underrun every 0.01 s * (1<<20) /
48000 = 200 ms, or on average about 1 frame every 400 ms.

This is observable in "Updating current time to" lines of
NSPR_LOG_MODULES=MediaStreamGraph:5 logs.
Comment on attachment 8427511 [details] [diff] [review]
use a consistent reference timestamp for graph time to avoid accumulating drift from rounding to MediaTime

>+        FromSeconds((MediaTimeToSeconds(nextCurrentTime - mStateComputedTime)));

I've removed one set of parentheses here.
https://hg.mozilla.org/integration/mozilla-inbound/rev/b112fc2312f9

No bright ideas for testing this, but bug 848954 should make this irrelevant anyway.
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/b112fc2312f9
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.