[go: nahoru, domu]

Switch to double for time calculations using playback rate.

Multiplying an int64 against a float causes the float type to prevail which does not have enough precision for accurate time value computations.

BUG= 475964

TBR=lcwu1, gunsch

Review URL: https://codereview.chromium.org/1094783002

Cr-Commit-Position: refs/heads/master@{#326269}
diff --git a/media/renderers/renderer_impl.h b/media/renderers/renderer_impl.h
index 3f90271c..79118488 100644
--- a/media/renderers/renderer_impl.h
+++ b/media/renderers/renderer_impl.h
@@ -55,7 +55,7 @@
               const CdmAttachedCB& cdm_attached_cb) final;
   void Flush(const base::Closure& flush_cb) final;
   void StartPlayingFrom(base::TimeDelta time) final;
-  void SetPlaybackRate(float playback_rate) final;
+  void SetPlaybackRate(double playback_rate) final;
   void SetVolume(float volume) final;
   base::TimeDelta GetMediaTime() final;
   bool HasAudio() final;
@@ -152,7 +152,7 @@
   TimeSource* time_source_;
   scoped_ptr<WallClockTimeSource> wall_clock_time_source_;
   bool time_ticking_;
-  float playback_rate_;
+  double playback_rate_;
 
   // The time to start playback from after starting/seeking has completed.
   base::TimeDelta start_time_;