Index: media/filters/audio_clock.h |
diff --git a/media/filters/audio_clock.h b/media/filters/audio_clock.h |
index 42ee2b660c23843ea77a2783d80c2c6d4d323b85..024c7915006d7486613e5c5c7dba8daf2a677749 100644 |
--- a/media/filters/audio_clock.h |
+++ b/media/filters/audio_clock.h |
@@ -7,7 +7,6 @@ |
#include <stdint.h> |
-#include <cmath> |
#include <deque> |
#include "base/macros.h" |
@@ -90,14 +89,8 @@ |
// |start_timestamp| since no amount of media frames tracked |
// media data has been played yet. by AudioClock, which would be |
// 1000 + 500 + 250 = 1750 ms. |
- base::TimeDelta front_timestamp() const { |
- return base::TimeDelta::FromMicroseconds( |
- std::round(front_timestamp_micros_)); |
- } |
- base::TimeDelta back_timestamp() const { |
- return base::TimeDelta::FromMicroseconds( |
- std::round(back_timestamp_micros_)); |
- } |
+ base::TimeDelta front_timestamp() const { return front_timestamp_; } |
+ base::TimeDelta back_timestamp() const { return back_timestamp_; } |
// Returns the amount of wall time until |timestamp| will be played by the |
// audio hardware. |
@@ -124,7 +117,7 @@ |
// Helpers for operating on |buffered_|. |
void PushBufferedAudioData(int64_t frames, double playback_rate); |
void PopBufferedAudioData(int64_t frames); |
- double ComputeBufferedMediaDurationMicros() const; |
+ base::TimeDelta ComputeBufferedMediaDuration() const; |
const base::TimeDelta start_timestamp_; |
const double microseconds_per_frame_; |
@@ -132,14 +125,8 @@ |
std::deque<AudioData> buffered_; |
int64_t total_buffered_frames_; |
- // Use double rather than TimeDelta to avoid loss of partial microseconds when |
- // converting between frames-written/delayed and time-passed (see conversion |
- // in WroteAudio()). Particularly for |back_timestamp|, which accumulates more |
- // time with each call to WroteAudio(), the loss of precision can accumulate |
- // to create noticeable audio/video sync drift for longer (2-3 hr) videos. |
- // See http://crbug.com/564604. |
- double front_timestamp_micros_; |
- double back_timestamp_micros_; |
+ base::TimeDelta front_timestamp_; |
+ base::TimeDelta back_timestamp_; |
DISALLOW_COPY_AND_ASSIGN(AudioClock); |
}; |