| Index: media/base/android/media_source_player.cc
|
| diff --git a/media/base/android/media_source_player.cc b/media/base/android/media_source_player.cc
|
| index 611c31338358e2098525ce20cea4e05df41c900b..01659556aecafecbdc2562dfaf0130b0d52b256d 100644
|
| --- a/media/base/android/media_source_player.cc
|
| +++ b/media/base/android/media_source_player.cc
|
| @@ -38,7 +38,7 @@ MediaSourcePlayer::MediaSourcePlayer(
|
| demuxer_(demuxer.Pass()),
|
| pending_event_(NO_EVENT_PENDING),
|
| playing_(false),
|
| - clock_(&default_tick_clock_),
|
| + interpolator_(&default_tick_clock_),
|
| doing_browser_seek_(false),
|
| pending_seek_(false),
|
| drm_bridge_(NULL),
|
| @@ -62,7 +62,7 @@ MediaSourcePlayer::MediaSourcePlayer(
|
| base::Bind(&MediaSourcePlayer::OnDemuxerConfigsChanged,
|
| weak_factory_.GetWeakPtr())));
|
| demuxer_->Initialize(this);
|
| - clock_.SetMaxTime(base::TimeDelta());
|
| + interpolator_.SetUpperBound(base::TimeDelta());
|
| weak_this_ = weak_factory_.GetWeakPtr();
|
| }
|
|
|
| @@ -90,7 +90,7 @@ void MediaSourcePlayer::ScheduleSeekEventAndStopDecoding(
|
|
|
| pending_seek_ = false;
|
|
|
| - clock_.SetTime(seek_time, seek_time);
|
| + interpolator_.SetBounds(seek_time, seek_time);
|
|
|
| if (audio_decoder_job_->is_decoding())
|
| audio_decoder_job_->StopDecode();
|
| @@ -173,7 +173,7 @@ void MediaSourcePlayer::SeekTo(base::TimeDelta timestamp) {
|
| }
|
|
|
| base::TimeDelta MediaSourcePlayer::GetCurrentTime() {
|
| - return std::min(clock_.Elapsed(), duration_);
|
| + return std::min(interpolator_.GetInterpolatedTime(), duration_);
|
| }
|
|
|
| base::TimeDelta MediaSourcePlayer::GetDuration() {
|
| @@ -328,7 +328,7 @@ void MediaSourcePlayer::OnDemuxerSeekDone(
|
| DCHECK(seek_time >= GetCurrentTime());
|
| DVLOG(1) << __FUNCTION__ << " : setting clock to actual browser seek time: "
|
| << seek_time.InSecondsF();
|
| - clock_.SetTime(seek_time, seek_time);
|
| + interpolator_.SetBounds(seek_time, seek_time);
|
| audio_decoder_job_->SetBaseTimestamp(seek_time);
|
| } else {
|
| DCHECK(actual_browser_seek_time == kNoTimestamp());
|
| @@ -354,7 +354,8 @@ void MediaSourcePlayer::OnDemuxerSeekDone(
|
| void MediaSourcePlayer::UpdateTimestamps(
|
| base::TimeDelta current_presentation_timestamp,
|
| base::TimeDelta max_presentation_timestamp) {
|
| - clock_.SetTime(current_presentation_timestamp, max_presentation_timestamp);
|
| + interpolator_.SetBounds(current_presentation_timestamp,
|
| + max_presentation_timestamp);
|
| manager()->OnTimeUpdate(player_id(), GetCurrentTime());
|
| }
|
|
|
| @@ -489,7 +490,7 @@ void MediaSourcePlayer::MediaDecoderCallback(
|
|
|
| if (!playing_) {
|
| if (is_clock_manager)
|
| - clock_.Pause();
|
| + interpolator_.StopInterpolating();
|
| return;
|
| }
|
|
|
| @@ -571,7 +572,7 @@ void MediaSourcePlayer::PlaybackCompleted(bool is_audio) {
|
|
|
| if (AudioFinished() && VideoFinished()) {
|
| playing_ = false;
|
| - clock_.Pause();
|
| + interpolator_.StopInterpolating();
|
| start_time_ticks_ = base::TimeTicks();
|
| manager()->OnPlaybackComplete(player_id());
|
| }
|
| @@ -670,8 +671,8 @@ void MediaSourcePlayer::OnPrefetchDone() {
|
|
|
| start_time_ticks_ = base::TimeTicks::Now();
|
| start_presentation_timestamp_ = GetCurrentTime();
|
| - if (!clock_.IsPlaying())
|
| - clock_.Play();
|
| + if (!interpolator_.interpolating())
|
| + interpolator_.StartInterpolating();
|
|
|
| if (!AudioFinished())
|
| DecodeMoreAudio();
|
|
|