Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Issue 1711473002: Use double microseconds for tracking back/front timestamp in AudioClock. (Closed)

Created:
4 years, 10 months ago by chcunningham
Modified:
4 years, 9 months ago
Reviewers:
DaleCurtis
CC:
chromium-reviews, feature-media-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use double microseconds for tracking back/front timestamp in AudioClock. Back timestamp is computed by summing the new frames_written for every call to WroteAudio. The number of microseconds per frame is often not a whole number (e.g. 20.833 mu for sample rate of 48Khz). Prior to this change, using TimeDelta to do the summing of frames_written meant we truncated to the nearest microsecond with every call to WroteAudio. The truncation error slowly accumulates in the back timestamp. After 2 hours of playback this error causes noticeable audio/video sync drift. Having front_timestamp be a double is less critical. Front timestamp is computed using back_timestamp at every call to WroteAudio, so fixing back implicitly fixes front. Still, I've changed them both to double for the sake of consistency and a slight improvement in accuracy. BUG=564604 Committed: https://crrev.com/2ed08018de0593b905c18500c1784464dcbe5468 Cr-Commit-Position: refs/heads/master@{#376287}

Patch Set 1 #

Patch Set 2 : Add unit test #

Total comments: 10

Patch Set 3 : Fixes for feedback && rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -41 lines) Patch
M media/filters/audio_clock.h View 1 2 4 chunks +18 lines, -5 lines 0 comments Download
M media/filters/audio_clock.cc View 7 chunks +24 lines, -18 lines 0 comments Download
M media/filters/audio_clock_unittest.cc View 1 2 5 chunks +41 lines, -18 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
chcunningham
This should fix the rest of the drift noticed in these 2-3 hour videos. Things ...
4 years, 10 months ago (2016-02-18 00:56:49 UTC) #2
DaleCurtis
Nice work! lgtm % nits. https://codereview.chromium.org/1711473002/diff/20001/media/filters/audio_clock.h File media/filters/audio_clock.h (right): https://codereview.chromium.org/1711473002/diff/20001/media/filters/audio_clock.h#newcode136 media/filters/audio_clock.h:136: // converting between frames-written/delayed ...
4 years, 10 months ago (2016-02-18 01:48:33 UTC) #3
chcunningham
Thanks Dale! https://codereview.chromium.org/1711473002/diff/20001/media/filters/audio_clock.h File media/filters/audio_clock.h (right): https://codereview.chromium.org/1711473002/diff/20001/media/filters/audio_clock.h#newcode136 media/filters/audio_clock.h:136: // converting between frames-written/delayed and time-passed (see ...
4 years, 10 months ago (2016-02-18 20:43:37 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1711473002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1711473002/40001
4 years, 10 months ago (2016-02-18 20:49:37 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 10 months ago (2016-02-18 22:10:54 UTC) #8
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/2ed08018de0593b905c18500c1784464dcbe5468 Cr-Commit-Position: refs/heads/master@{#376287}
4 years, 10 months ago (2016-02-18 22:11:41 UTC) #10
Kunihiko Sakamoto
A revert of this CL (patchset #3 id:40001) has been created in https://codereview.chromium.org/1716753002/ by ksakamoto@chromium.org. ...
4 years, 10 months ago (2016-02-19 06:54:23 UTC) #11
chcunningham
4 years, 9 months ago (2016-03-16 04:56:02 UTC) #12
Message was sent while issue was closed.
On 2016/02/19 06:54:23, Kunihiko Sakamoto wrote:
> A revert of this CL (patchset #3 id:40001) has been created in
> https://codereview.chromium.org/1716753002/ by mailto:ksakamoto@chromium.org.
> 
> The reason for reverting is: Speculative revert: appears to break blink layout
> test webaudio/periodicwave-normalization.html on Linux Debug.
>
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20(dbg)/....

Just for posterity, this CL was not reverted (though I completely understand how
it was suspected). Landed without issue.

Powered by Google App Engine
This is Rietveld 408576698