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

Issue 1729273003: [TO M49] Use double microseconds for tracking back/front timestamp in AudioClock. (Closed)

Created:
4 years, 10 months ago by chcunningham
Modified:
4 years, 10 months ago
Reviewers:
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2623
Target Ref:
refs/pending/branch-heads/2623
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 Review URL: https://codereview.chromium.org/1711473002 Cr-Commit-Position: refs/heads/master@{#376287} (cherry picked from commit 2ed08018de0593b905c18500c1784464dcbe5468) Committed: https://chromium.googlesource.com/chromium/src/+/11f31429480770414493d53c38f9e929e10d688f

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -41 lines) Patch
M media/filters/audio_clock.h View 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 5 chunks +41 lines, -18 lines 0 comments Download

Messages

Total messages: 3 (2 generated)
chcunningham
4 years, 10 months ago (2016-02-25 00:04:06 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
11f31429480770414493d53c38f9e929e10d688f.

Powered by Google App Engine
This is Rietveld 408576698