diff options
author | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-14 23:30:57 +0000 |
---|---|---|
committer | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-14 23:30:57 +0000 |
commit | 50bba44020b4848b41f29408688287f3c209770e (patch) | |
tree | aa61cf1072f0b79075da661e500ea4ed580ed340 /webkit | |
parent | d4ab09f74972bd4e9d56a25de77ef67917e813eb (diff) | |
download | chromium_src-50bba44020b4848b41f29408688287f3c209770e.zip chromium_src-50bba44020b4848b41f29408688287f3c209770e.tar.gz chromium_src-50bba44020b4848b41f29408688287f3c209770e.tar.bz2 |
Make ChunkDemuxer::SetTimestampOffset take a TimeDelta instead of double
ChunkDemuxerTest.TestDurationChangeTimestampOffset tickled a precision error in
32-bit linux due to the division by InSecondsF(). This situation can be avoided
by moving the double -> TimeDelta conversion into WebMediaPlayerImpl so that
ChunkDemuxer can compute all times in terms of TimeDeltas.
BUG=NONE
Review URL: https://chromiumcodereview.appspot.com/10823300
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151601 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/media/webmediaplayer_impl.cc | 4 | ||||
-rw-r--r-- | webkit/media/webmediaplayer_proxy.cc | 2 | ||||
-rw-r--r-- | webkit/media/webmediaplayer_proxy.h | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc index 90bad00..706ca84 100644 --- a/webkit/media/webmediaplayer_impl.cc +++ b/webkit/media/webmediaplayer_impl.cc @@ -687,7 +687,9 @@ void WebMediaPlayerImpl::sourceEndOfStream( bool WebMediaPlayerImpl::sourceSetTimestampOffset(const WebKit::WebString& id, double offset) { - return proxy_->DemuxerSetTimestampOffset(id.utf8().data(), offset); + base::TimeDelta time_offset = base::TimeDelta::FromMicroseconds( + offset * base::Time::kMicrosecondsPerSecond); + return proxy_->DemuxerSetTimestampOffset(id.utf8().data(), time_offset); } WebKit::WebMediaPlayer::MediaKeyException diff --git a/webkit/media/webmediaplayer_proxy.cc b/webkit/media/webmediaplayer_proxy.cc index 100d591..bac3d8b 100644 --- a/webkit/media/webmediaplayer_proxy.cc +++ b/webkit/media/webmediaplayer_proxy.cc @@ -201,7 +201,7 @@ media::ChunkDemuxer::Status WebMediaPlayerProxy::DemuxerAddId( } bool WebMediaPlayerProxy::DemuxerSetTimestampOffset( - const std::string& id, double offset) { + const std::string& id, base::TimeDelta offset) { return chunk_demuxer_->SetTimestampOffset(id, offset); } diff --git a/webkit/media/webmediaplayer_proxy.h b/webkit/media/webmediaplayer_proxy.h index 30bd1d5..69e0e2c 100644 --- a/webkit/media/webmediaplayer_proxy.h +++ b/webkit/media/webmediaplayer_proxy.h @@ -98,7 +98,7 @@ class WebMediaPlayerProxy void DemuxerAbort(const std::string& id); void DemuxerEndOfStream(media::PipelineStatus status); void DemuxerShutdown(); - bool DemuxerSetTimestampOffset(const std::string& id, double offset); + bool DemuxerSetTimestampOffset(const std::string& id, base::TimeDelta offset); // DecryptorClient implementation. virtual void KeyAdded(const std::string& key_system, |