<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[169568] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/169568">169568</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2014-06-03 14:09:07 -0700 (Tue, 03 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update PlatformTimeRanges to use MediaTime rather than doubles for time values.
https://bugs.webkit.org/show_bug.cgi?id=133454

Reviewed by Eric Carlson.

Source/WebCore:
PlatformTimeRanges will now use MediaTime, so operations at the platform level won't
lose precision when converting to and from doubles and rational time values like CMTime.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::currentTimeFudgeFactor):
(WebCore::SourceBuffer::hasCurrentTime):
(WebCore::SourceBuffer::hasFutureTime):
(WebCore::SourceBuffer::canPlayThrough):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/TimeRanges.cpp:
(WebCore::TimeRanges::TimeRanges):
(WebCore::TimeRanges::start):
(WebCore::TimeRanges::end):
(WebCore::TimeRanges::add):
(WebCore::TimeRanges::contain):
(WebCore::TimeRanges::find):
(WebCore::TimeRanges::nearest):
(WebCore::TimeRanges::totalDuration):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::seekable):
* platform/graphics/PlatformTimeRanges.cpp:
(WebCore::PlatformTimeRanges::create):
(WebCore::PlatformTimeRanges::PlatformTimeRanges):
(WebCore::PlatformTimeRanges::invert):
(WebCore::PlatformTimeRanges::start):
(WebCore::PlatformTimeRanges::end):
(WebCore::PlatformTimeRanges::add):
(WebCore::PlatformTimeRanges::contain):
(WebCore::PlatformTimeRanges::find):
(WebCore::PlatformTimeRanges::nearest):
(WebCore::PlatformTimeRanges::totalDuration):
* platform/graphics/PlatformTimeRanges.h:
(WebCore::PlatformTimeRanges::Range::Range):
(WebCore::PlatformTimeRanges::Range::isPointInRange):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered): Deleted.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::buffered):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::buffered):
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::advanceCurrentTime):

LayoutTests:
Update the video-pause-immediately to allow for small floating point differences.

* media/video-pause-immediately-expected.txt:
* media/video-pause-immediately.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediavideopauseimmediatelyexpectedtxt">trunk/LayoutTests/media/video-pause-immediately-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediavideopauseimmediatelyhtml">trunk/LayoutTests/media/video-pause-immediately.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBuffercpp">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlTimeRangescpp">trunk/Source/WebCore/html/TimeRanges.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPlatformTimeRangescpp">trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPlatformTimeRangesh">trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourcecpp">trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/LayoutTests/ChangeLog        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-06-02  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        Update PlatformTimeRanges to use MediaTime rather than doubles for time values.
+        https://bugs.webkit.org/show_bug.cgi?id=133454
+
+        Reviewed by Eric Carlson.
+
+        Update the video-pause-immediately to allow for small floating point differences.
+
+        * media/video-pause-immediately-expected.txt:
+        * media/video-pause-immediately.html:
+
</ins><span class="cx"> 2014-06-03  Eva Balazsfalvi  &lt;evab.u-szeged@partner.samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r169092 and r169102): Skip failing JSC tests poperly on non-x86 Darwin platforms
</span></span></pre></div>
<a id="trunkLayoutTestsmediavideopauseimmediatelyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/video-pause-immediately-expected.txt (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/video-pause-immediately-expected.txt        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/LayoutTests/media/video-pause-immediately-expected.txt        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> EVENT(canplay)
</span><span class="cx"> EVENT(playing)
</span><span class="cx"> EVENT(pause)
</span><del>-EXPECTED ((video.currentTime - timeAfterPause) == '0') OK
-EXPECTED ((video.played.end(0) - timeAfterPause) == '0') OK
</del><ins>+EXPECTED ((video.currentTime - timeAfterPause) &lt; '0.0001') OK
+EXPECTED ((video.played.end(0) - timeAfterPause) &lt; '0.0001') OK
</ins><span class="cx"> END OF TEST
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsmediavideopauseimmediatelyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/video-pause-immediately.html (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/video-pause-immediately.html        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/LayoutTests/media/video-pause-immediately.html        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx"> 
</span><span class="cx">             function pause()
</span><span class="cx">             {
</span><del>-                testExpected(&quot;(video.currentTime - timeAfterPause)&quot;, 0);
-                testExpected(&quot;(video.played.end(0) - timeAfterPause)&quot;, 0);
</del><ins>+                testExpected(&quot;(video.currentTime - timeAfterPause)&quot;, 0.0001, &quot;&lt;&quot;);
+                testExpected(&quot;(video.played.end(0) - timeAfterPause)&quot;, 0.0001, &quot;&lt;&quot;);
</ins><span class="cx">                 endTest();
</span><span class="cx">             }
</span><span class="cx">         &lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/ChangeLog        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -1,3 +1,61 @@
</span><ins>+2014-06-02  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        Update PlatformTimeRanges to use MediaTime rather than doubles for time values.
+        https://bugs.webkit.org/show_bug.cgi?id=133454
+
+        Reviewed by Eric Carlson.
+
+        PlatformTimeRanges will now use MediaTime, so operations at the platform level won't
+        lose precision when converting to and from doubles and rational time values like CMTime.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::currentTimeFudgeFactor):
+        (WebCore::SourceBuffer::hasCurrentTime):
+        (WebCore::SourceBuffer::hasFutureTime):
+        (WebCore::SourceBuffer::canPlayThrough):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::parseAttribute):
+        * html/TimeRanges.cpp:
+        (WebCore::TimeRanges::TimeRanges):
+        (WebCore::TimeRanges::start):
+        (WebCore::TimeRanges::end):
+        (WebCore::TimeRanges::add):
+        (WebCore::TimeRanges::contain):
+        (WebCore::TimeRanges::find):
+        (WebCore::TimeRanges::nearest):
+        (WebCore::TimeRanges::totalDuration):
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::seekable):
+        * platform/graphics/PlatformTimeRanges.cpp:
+        (WebCore::PlatformTimeRanges::create):
+        (WebCore::PlatformTimeRanges::PlatformTimeRanges):
+        (WebCore::PlatformTimeRanges::invert):
+        (WebCore::PlatformTimeRanges::start):
+        (WebCore::PlatformTimeRanges::end):
+        (WebCore::PlatformTimeRanges::add):
+        (WebCore::PlatformTimeRanges::contain):
+        (WebCore::PlatformTimeRanges::find):
+        (WebCore::PlatformTimeRanges::nearest):
+        (WebCore::PlatformTimeRanges::totalDuration):
+        * platform/graphics/PlatformTimeRanges.h:
+        (WebCore::PlatformTimeRanges::Range::Range):
+        (WebCore::PlatformTimeRanges::Range::isPointInRange):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost):
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered): Deleted.
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivateQTKit::buffered):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::buffered):
+        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
+        (WebCore::MockMediaPlayerMediaSource::advanceCurrentTime):
+
</ins><span class="cx"> 2014-06-03  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS][WK2] Align the highlight rects with device pixels
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -60,7 +60,11 @@
</span><span class="cx"> static double ExponentialMovingAverageCoefficient = 0.1;
</span><span class="cx"> 
</span><span class="cx"> // Allow hasCurrentTime() to be off by as much as the length of a 24fps video frame
</span><del>-static double CurrentTimeFudgeFactor = 1. / 24;
</del><ins>+static const MediaTime&amp; currentTimeFudgeFactor()
+{
+    static NeverDestroyed&lt;MediaTime&gt; fudgeFactor(1, 24);
+    return fudgeFactor;
+}
</ins><span class="cx"> 
</span><span class="cx"> struct SourceBuffer::TrackBuffer {
</span><span class="cx">     MediaTime lastDecodeTimestamp;
</span><span class="lines">@@ -1385,8 +1389,8 @@
</span><span class="cx">     if (isRemoved() || !m_buffered-&gt;length())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    double currentTime = m_source-&gt;currentTime();
-    return fabs(m_buffered-&gt;nearest(m_source-&gt;currentTime()) - currentTime) &lt;= CurrentTimeFudgeFactor;
</del><ins>+    MediaTime currentTime = MediaTime::createWithDouble(m_source-&gt;currentTime());
+    return abs(m_buffered-&gt;ranges().nearest(currentTime) - currentTime) &lt;= currentTimeFudgeFactor();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SourceBuffer::hasFutureTime() const
</span><span class="lines">@@ -1394,20 +1398,20 @@
</span><span class="cx">     if (isRemoved())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    double currentTime = m_source-&gt;currentTime();
</del><span class="cx">     const PlatformTimeRanges&amp; ranges = m_buffered-&gt;ranges();
</span><span class="cx">     if (!ranges.length())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    double nearest = m_buffered-&gt;nearest(m_source-&gt;currentTime());
-    if (fabs(m_buffered-&gt;nearest(m_source-&gt;currentTime()) - currentTime) &gt; CurrentTimeFudgeFactor)
</del><ins>+    MediaTime currentTime = MediaTime::createWithDouble(m_source-&gt;currentTime());
+    MediaTime nearest = ranges.nearest(currentTime);
+    if (abs(nearest - currentTime) &gt; currentTimeFudgeFactor())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     size_t found = ranges.find(nearest);
</span><span class="cx">     ASSERT(found != notFound);
</span><span class="cx"> 
</span><span class="cx">     bool ignoredValid = false;
</span><del>-    return ranges.end(found, ignoredValid) - currentTime &gt; CurrentTimeFudgeFactor;
</del><ins>+    return ranges.end(found, ignoredValid) - currentTime &gt; currentTimeFudgeFactor();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SourceBuffer::canPlayThrough()
</span><span class="lines">@@ -1423,9 +1427,9 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     // Add up all the time yet to be buffered.
</span><del>-    double unbufferedTime = 0;
-    double currentTime = m_source-&gt;currentTime();
-    double duration = m_source-&gt;duration();
</del><ins>+    MediaTime unbufferedTime = MediaTime::zeroTime();
+    MediaTime currentTime = MediaTime::createWithDouble(m_source-&gt;currentTime());
+    MediaTime duration = MediaTime::createWithDouble(m_source-&gt;duration());
</ins><span class="cx"> 
</span><span class="cx">     PlatformTimeRanges unbufferedRanges = m_buffered-&gt;ranges();
</span><span class="cx">     unbufferedRanges.invert();
</span><span class="lines">@@ -1435,8 +1439,8 @@
</span><span class="cx">     for (size_t i = 0, end = unbufferedRanges.length(); i &lt; end; ++i)
</span><span class="cx">         unbufferedTime += unbufferedRanges.end(i, valid) - unbufferedRanges.start(i, valid);
</span><span class="cx"> 
</span><del>-    double timeRemaining = duration - currentTime;
-    return unbufferedTime / m_averageBufferRate &lt; timeRemaining;
</del><ins>+    MediaTime timeRemaining = duration - currentTime;
+    return unbufferedTime.toDouble() / m_averageBufferRate &lt; timeRemaining.toDouble();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBuffer::reportExtraMemoryCost()
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -3165,15 +3165,15 @@
</span><span class="cx">     if (!duration || std::isinf(duration))
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    double buffered = 0;
</del><ins>+    MediaTime buffered = MediaTime::zeroTime();
</ins><span class="cx">     bool ignored;
</span><span class="cx">     std::unique_ptr&lt;PlatformTimeRanges&gt; timeRanges = m_player-&gt;buffered();
</span><span class="cx">     for (unsigned i = 0; i &lt; timeRanges-&gt;length(); ++i) {
</span><del>-        double start = timeRanges-&gt;start(i, ignored);
-        double end = timeRanges-&gt;end(i, ignored);
</del><ins>+        MediaTime start = timeRanges-&gt;start(i, ignored);
+        MediaTime end = timeRanges-&gt;end(i, ignored);
</ins><span class="cx">         buffered += end - start;
</span><span class="cx">     }
</span><del>-    return buffered / duration;
</del><ins>+    return buffered.toDouble() / duration;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTimeRangescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TimeRanges.cpp (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TimeRanges.cpp        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/html/TimeRanges.cpp        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TimeRanges::TimeRanges(double start, double end)
</span><del>-    : m_ranges(PlatformTimeRanges(start, end))
</del><ins>+    : m_ranges(PlatformTimeRanges(MediaTime::createWithDouble(start), MediaTime::createWithDouble(end)))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -64,25 +64,25 @@
</span><span class="cx"> double TimeRanges::start(unsigned index, ExceptionCode&amp; ec) const
</span><span class="cx"> {
</span><span class="cx">     bool valid;
</span><del>-    double result = m_ranges.start(index, valid);
</del><ins>+    MediaTime result = m_ranges.start(index, valid);
</ins><span class="cx"> 
</span><span class="cx">     if (!valid) {
</span><span class="cx">         ec = INDEX_SIZE_ERR;
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><del>-    return result;
</del><ins>+    return result.toDouble();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double TimeRanges::end(unsigned index, ExceptionCode&amp; ec) const 
</span><span class="cx"> { 
</span><span class="cx">     bool valid;
</span><del>-    double result = m_ranges.end(index, valid);
</del><ins>+    MediaTime result = m_ranges.end(index, valid);
</ins><span class="cx"> 
</span><span class="cx">     if (!valid) {
</span><span class="cx">         ec = INDEX_SIZE_ERR;
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><del>-    return result;
</del><ins>+    return result.toDouble();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TimeRanges::invert()
</span><span class="lines">@@ -112,27 +112,27 @@
</span><span class="cx"> 
</span><span class="cx"> void TimeRanges::add(double start, double end)
</span><span class="cx"> {
</span><del>-    m_ranges.add(start, end);
</del><ins>+    m_ranges.add(MediaTime::createWithDouble(start), MediaTime::createWithDouble(end));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool TimeRanges::contain(double time) const
</span><span class="cx"> {
</span><del>-    return m_ranges.contain(time);
</del><ins>+    return m_ranges.contain(MediaTime::createWithDouble(time));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> size_t TimeRanges::find(double time) const
</span><span class="cx"> {
</span><del>-    return m_ranges.find(time);
</del><ins>+    return m_ranges.find(MediaTime::createWithDouble(time));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double TimeRanges::nearest(double time) const
</span><span class="cx"> {
</span><del>-    return m_ranges.nearest(time);
</del><ins>+    return m_ranges.nearest(MediaTime::createWithDouble(time)).toDouble();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double TimeRanges::totalDuration() const
</span><span class="cx"> {
</span><del>-    return m_ranges.totalDuration();
</del><ins>+    return m_ranges.totalDuration().toDouble();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx">     virtual MediaPlayer::NetworkState networkState() const = 0;
</span><span class="cx">     virtual MediaPlayer::ReadyState readyState() const = 0;
</span><span class="cx"> 
</span><del>-    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; seekable() const { return maxTimeSeekableDouble() ? PlatformTimeRanges::create(minTimeSeekable(), maxTimeSeekableDouble()) : PlatformTimeRanges::create(); }
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; seekable() const { return maxTimeSeekableDouble() ? PlatformTimeRanges::create(MediaTime::createWithDouble(minTimeSeekable()), MediaTime::createWithDouble(maxTimeSeekableDouble())) : PlatformTimeRanges::create(); }
</ins><span class="cx">     virtual float maxTimeSeekable() const { return 0; }
</span><span class="cx">     virtual double maxTimeSeekableDouble() const { return maxTimeSeekable(); }
</span><span class="cx">     virtual double minTimeSeekable() const { return 0; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPlatformTimeRangescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.cpp (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.cpp        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.cpp        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">     return std::make_unique&lt;PlatformTimeRanges&gt;();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;PlatformTimeRanges&gt; PlatformTimeRanges::create(double start, double end)
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; PlatformTimeRanges::create(const MediaTime&amp; start, const MediaTime&amp; end)
</ins><span class="cx"> {
</span><span class="cx">     return std::make_unique&lt;PlatformTimeRanges&gt;(start, end);
</span><span class="cx"> }
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">     return std::make_unique&lt;PlatformTimeRanges&gt;(other);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-PlatformTimeRanges::PlatformTimeRanges(double start, double end)
</del><ins>+PlatformTimeRanges::PlatformTimeRanges(const MediaTime&amp; start, const MediaTime&amp; end)
</ins><span class="cx"> {
</span><span class="cx">     add(start, end);
</span><span class="cx"> }
</span><span class="lines">@@ -72,20 +72,20 @@
</span><span class="cx"> void PlatformTimeRanges::invert()
</span><span class="cx"> {
</span><span class="cx">     PlatformTimeRanges inverted;
</span><del>-    double posInf = std::numeric_limits&lt;double&gt;::infinity();
-    double negInf = -std::numeric_limits&lt;double&gt;::infinity();
</del><ins>+    MediaTime posInf = MediaTime::positiveInfiniteTime();
+    MediaTime negInf = MediaTime::negativeInfiniteTime();
</ins><span class="cx"> 
</span><span class="cx">     if (!m_ranges.size())
</span><span class="cx">         inverted.add(negInf, posInf);
</span><span class="cx">     else {
</span><del>-        double start = m_ranges.first().m_start;
</del><ins>+        MediaTime start = m_ranges.first().m_start;
</ins><span class="cx">         if (start != negInf)
</span><span class="cx">             inverted.add(negInf, start);
</span><span class="cx"> 
</span><span class="cx">         for (size_t index = 0; index + 1 &lt; m_ranges.size(); ++index)
</span><span class="cx">             inverted.add(m_ranges[index].m_end, m_ranges[index + 1].m_start);
</span><span class="cx"> 
</span><del>-        double end = m_ranges.last().m_end;
</del><ins>+        MediaTime end = m_ranges.last().m_end;
</ins><span class="cx">         if (end != posInf)
</span><span class="cx">             inverted.add(end, posInf);
</span><span class="cx">     }
</span><span class="lines">@@ -115,29 +115,29 @@
</span><span class="cx">     m_ranges.swap(unioned.m_ranges);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double PlatformTimeRanges::start(unsigned index, bool&amp; valid) const
</del><ins>+MediaTime PlatformTimeRanges::start(unsigned index, bool&amp; valid) const
</ins><span class="cx"> { 
</span><span class="cx">     if (index &gt;= length()) {
</span><span class="cx">         valid = false;
</span><del>-        return 0;
</del><ins>+        return MediaTime::zeroTime();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     valid = true;
</span><span class="cx">     return m_ranges[index].m_start;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double PlatformTimeRanges::end(unsigned index, bool&amp; valid) const
</del><ins>+MediaTime PlatformTimeRanges::end(unsigned index, bool&amp; valid) const
</ins><span class="cx"> { 
</span><span class="cx">     if (index &gt;= length()) {
</span><span class="cx">         valid = false;
</span><del>-        return 0;
</del><ins>+        return MediaTime::zeroTime();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     valid = true;
</span><span class="cx">     return m_ranges[index].m_end;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformTimeRanges::add(double start, double end)
</del><ins>+void PlatformTimeRanges::add(const MediaTime&amp; start, const MediaTime&amp; end)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(start &lt;= end);
</span><span class="cx">     unsigned overlappingArcIndex;
</span><span class="lines">@@ -178,12 +178,12 @@
</span><span class="cx">     m_ranges.insert(overlappingArcIndex, addedRange);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PlatformTimeRanges::contain(double time) const
</del><ins>+bool PlatformTimeRanges::contain(const MediaTime&amp; time) const
</ins><span class="cx"> {
</span><span class="cx">     return find(time) != notFound;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-size_t PlatformTimeRanges::find(double time) const
</del><ins>+size_t PlatformTimeRanges::find(const MediaTime&amp; time) const
</ins><span class="cx"> {
</span><span class="cx">     bool ignoreInvalid;
</span><span class="cx">     for (unsigned n = 0; n &lt; length(); n++) {
</span><span class="lines">@@ -193,26 +193,26 @@
</span><span class="cx">     return notFound;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double PlatformTimeRanges::nearest(double time) const
</del><ins>+MediaTime PlatformTimeRanges::nearest(const MediaTime&amp; time) const
</ins><span class="cx"> {
</span><del>-    double closestDelta = std::numeric_limits&lt;double&gt;::infinity();
-    double closestTime = 0;
</del><ins>+    MediaTime closestDelta = MediaTime::positiveInfiniteTime();
+    MediaTime closestTime = MediaTime::zeroTime();
</ins><span class="cx">     unsigned count = length();
</span><span class="cx">     bool ignoreInvalid;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned ndx = 0; ndx &lt; count; ndx++) {
</span><del>-        double startTime = start(ndx, ignoreInvalid);
-        double endTime = end(ndx, ignoreInvalid);
</del><ins>+        MediaTime startTime = start(ndx, ignoreInvalid);
+        MediaTime endTime = end(ndx, ignoreInvalid);
</ins><span class="cx">         if (time &gt;= startTime &amp;&amp; time &lt;= endTime)
</span><span class="cx">             return time;
</span><span class="cx"> 
</span><del>-        double startTimeDelta = fabs(startTime - time);
</del><ins>+        MediaTime startTimeDelta = abs(startTime - time);
</ins><span class="cx">         if (startTimeDelta &lt; closestDelta) {
</span><span class="cx">             closestTime = startTime;
</span><span class="cx">             closestDelta = startTimeDelta;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        double endTimeDelta = fabs(endTime - time);
</del><ins>+        MediaTime endTimeDelta = abs(endTime - time);
</ins><span class="cx">         if (endTimeDelta &lt; closestDelta) {
</span><span class="cx">             closestTime = endTime;
</span><span class="cx">             closestDelta = endTimeDelta;
</span><span class="lines">@@ -221,13 +221,13 @@
</span><span class="cx">     return closestTime;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double PlatformTimeRanges::totalDuration() const
</del><ins>+MediaTime PlatformTimeRanges::totalDuration() const
</ins><span class="cx"> {
</span><del>-    double total = 0;
</del><ins>+    MediaTime total = MediaTime::zeroTime();
</ins><span class="cx">     bool ignoreInvalid;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned n = 0; n &lt; length(); n++)
</span><del>-        total += fabs(end(n, ignoreInvalid) - start(n, ignoreInvalid));
</del><ins>+        total += abs(end(n, ignoreInvalid) - start(n, ignoreInvalid));
</ins><span class="cx">     return total;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPlatformTimeRangesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.h (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.h        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.h        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define PlatformTimeRanges_h
</span><span class="cx"> 
</span><span class="cx"> #include &lt;algorithm&gt;
</span><ins>+#include &lt;wtf/MediaTime.h&gt;
</ins><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="lines">@@ -36,17 +37,17 @@
</span><span class="cx"> class PlatformTimeRanges {
</span><span class="cx"> public:
</span><span class="cx">     static std::unique_ptr&lt;PlatformTimeRanges&gt; create();
</span><del>-    static std::unique_ptr&lt;PlatformTimeRanges&gt; create(double start, double end);
</del><ins>+    static std::unique_ptr&lt;PlatformTimeRanges&gt; create(const MediaTime&amp; start, const MediaTime&amp; end);
</ins><span class="cx">     static std::unique_ptr&lt;PlatformTimeRanges&gt; create(const PlatformTimeRanges&amp;);
</span><span class="cx"> 
</span><span class="cx">     explicit PlatformTimeRanges() { }
</span><del>-    PlatformTimeRanges(double start, double end);
</del><ins>+    PlatformTimeRanges(const MediaTime&amp; start, const MediaTime&amp; end);
</ins><span class="cx">     PlatformTimeRanges(const PlatformTimeRanges&amp;);
</span><span class="cx"> 
</span><span class="cx">     PlatformTimeRanges&amp; operator=(const PlatformTimeRanges&amp;);
</span><span class="cx"> 
</span><del>-    double start(unsigned index, bool&amp; valid) const;
-    double end(unsigned index, bool&amp; valid) const;
</del><ins>+    MediaTime start(unsigned index, bool&amp; valid) const;
+    MediaTime end(unsigned index, bool&amp; valid) const;
</ins><span class="cx"> 
</span><span class="cx">     void invert();
</span><span class="cx">     void intersectWith(const PlatformTimeRanges&amp;);
</span><span class="lines">@@ -54,15 +55,15 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned length() const { return m_ranges.size(); }
</span><span class="cx"> 
</span><del>-    void add(double start, double end);
</del><ins>+    void add(const MediaTime&amp; start, const MediaTime&amp; end);
</ins><span class="cx">     
</span><del>-    bool contain(double time) const;
</del><ins>+    bool contain(const MediaTime&amp;) const;
</ins><span class="cx"> 
</span><del>-    size_t find(double time) const;
</del><ins>+    size_t find(const MediaTime&amp;) const;
</ins><span class="cx">     
</span><del>-    double nearest(double time) const;
</del><ins>+    MediaTime nearest(const MediaTime&amp;) const;
</ins><span class="cx"> 
</span><del>-    double totalDuration() const;
</del><ins>+    MediaTime totalDuration() const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     PlatformTimeRanges&amp; copy(const PlatformTimeRanges&amp;);
</span><span class="lines">@@ -70,15 +71,16 @@
</span><span class="cx">     // We consider all the Ranges to be semi-bounded as follow: [start, end[
</span><span class="cx">     struct Range {
</span><span class="cx">         Range() { }
</span><del>-        Range(double start, double end)
</del><ins>+        Range(const MediaTime&amp; start, const MediaTime&amp; end)
+            : m_start(start)
+            , m_end(end)
</ins><span class="cx">         {
</span><del>-            m_start = start;
-            m_end = end;
</del><span class="cx">         }
</span><del>-        double m_start;
-        double m_end;
</del><span class="cx"> 
</span><del>-        inline bool isPointInRange(double point) const
</del><ins>+        MediaTime m_start;
+        MediaTime m_end;
+
+        inline bool isPointInRange(const MediaTime&amp; point) const
</ins><span class="cx">         {
</span><span class="cx">             return m_start &lt;= point &amp;&amp; point &lt; m_end;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -946,7 +946,7 @@
</span><span class="cx">     if (!duration)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    unsigned long long extra = totalBytes() * buffered()-&gt;totalDuration() / duration;
</del><ins>+    unsigned long long extra = totalBytes() * buffered()-&gt;totalDuration().toDouble() / duration;
</ins><span class="cx">     return static_cast&lt;unsigned&gt;(extra);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -638,9 +638,9 @@
</span><span class="cx">         CMTime duration = CMTimeMakeFromDictionary(static_cast&lt;CFDictionaryRef&gt;(CFDictionaryGetValue(range, CMTimeRangeDurationKey())));
</span><span class="cx">         
</span><span class="cx">         if (timeRangeIsValidAndNotEmpty(start, duration)) {
</span><del>-            float rangeStart = narrowPrecisionToFloat(CMTimeGetSeconds(start));
-            float rangeEnd = narrowPrecisionToFloat(CMTimeGetSeconds(CMTimeAdd(start, duration)));
-            timeRanges-&gt;add(rangeStart, rangeEnd);
</del><ins>+            double rangeStart = CMTimeGetSeconds(start);
+            double rangeEnd = rangeStart + CMTimeGetSeconds(duration);
+            timeRanges-&gt;add(MediaTime::createWithDouble(rangeStart), MediaTime::createWithDouble(rangeEnd));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> #import &quot;OutOfBandTextTrackPrivateAVF.h&quot;
</span><span class="cx"> #import &quot;URL.h&quot;
</span><span class="cx"> #import &quot;Logging.h&quot;
</span><ins>+#import &quot;MediaTimeMac.h&quot;
</ins><span class="cx"> #import &quot;PlatformTimeRanges.h&quot;
</span><span class="cx"> #import &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #import &quot;SerializedPlatformRepresentationMac.h&quot;
</span><span class="lines">@@ -1090,11 +1091,8 @@
</span><span class="cx"> 
</span><span class="cx">     for (NSValue *thisRangeValue in m_cachedLoadedRanges.get()) {
</span><span class="cx">         CMTimeRange timeRange = [thisRangeValue CMTimeRangeValue];
</span><del>-        if (CMTIMERANGE_IS_VALID(timeRange) &amp;&amp; !CMTIMERANGE_IS_EMPTY(timeRange)) {
-            float rangeStart = narrowPrecisionToFloat(CMTimeGetSeconds(timeRange.start));
-            float rangeEnd = narrowPrecisionToFloat(CMTimeGetSeconds(CMTimeRangeGetEnd(timeRange)));
-            timeRanges-&gt;add(rangeStart, rangeEnd);
-        }
</del><ins>+        if (CMTIMERANGE_IS_VALID(timeRange) &amp;&amp; !CMTIMERANGE_IS_EMPTY(timeRange))
+            timeRanges-&gt;add(toMediaTime(timeRange.start), toMediaTime(CMTimeRangeGetEnd(timeRange)));
</ins><span class="cx">     }
</span><span class="cx">     return timeRanges;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -464,7 +464,7 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayerPrivateMediaSourceAVFObjC::seekable() const
</span><span class="cx"> {
</span><del>-    return PlatformTimeRanges::create(minTimeSeekable(), maxTimeSeekableDouble());
</del><ins>+    return PlatformTimeRanges::create(MediaTime::createWithDouble(minTimeSeekable()), MediaTime::createWithDouble(maxTimeSeekableDouble()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -865,21 +865,21 @@
</span><span class="cx">     for (guint index = 0; index &lt; gst_query_get_n_buffering_ranges(query); index++) {
</span><span class="cx">         gint64 rangeStart = 0, rangeStop = 0;
</span><span class="cx">         if (gst_query_parse_nth_buffering_range(query, index, &amp;rangeStart, &amp;rangeStop))
</span><del>-            timeRanges-&gt;add(static_cast&lt;float&gt;((rangeStart * mediaDuration) / GST_FORMAT_PERCENT_MAX),
-                static_cast&lt;float&gt;((rangeStop * mediaDuration) / GST_FORMAT_PERCENT_MAX));
</del><ins>+            timeRanges-&gt;add(MediaTime::createWithDouble((rangeStart * mediaDuration) / GST_FORMAT_PERCENT_MAX),
+                MediaTime::createWithDouble((rangeStop * mediaDuration) / GST_FORMAT_PERCENT_MAX));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Fallback to the more general maxTimeLoaded() if no range has
</span><span class="cx">     // been found.
</span><span class="cx">     if (!timeRanges-&gt;length())
</span><span class="cx">         if (float loaded = maxTimeLoaded())
</span><del>-            timeRanges-&gt;add(0, loaded);
</del><ins>+            timeRanges-&gt;add(MediaTime::zeroTime(), MediaTime::createWithDouble(loaded));
</ins><span class="cx"> 
</span><span class="cx">     gst_query_unref(query);
</span><span class="cx"> #else
</span><span class="cx">     float loaded = maxTimeLoaded();
</span><span class="cx">     if (!m_errorOccured &amp;&amp; !isLiveStream() &amp;&amp; loaded &gt; 0)
</span><del>-        timeRanges-&gt;add(0, loaded);
</del><ins>+        timeRanges-&gt;add(MediaTime::zeroTime(), MediaTime::createWithDouble(loaded));
</ins><span class="cx"> #endif
</span><span class="cx">     return timeRanges;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -922,7 +922,7 @@
</span><span class="cx">     auto timeRanges = PlatformTimeRanges::create();
</span><span class="cx">     float loaded = maxTimeLoaded();
</span><span class="cx">     if (loaded &gt; 0)
</span><del>-        timeRanges-&gt;add(0, loaded);
</del><ins>+        timeRanges-&gt;add(MediaTime::zeroTime(), MediaTime::createWithDouble(loaded));
</ins><span class="cx">     return timeRanges;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp (169567 => 169568)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp        2014-06-03 20:59:04 UTC (rev 169567)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp        2014-06-03 21:09:07 UTC (rev 169568)
</span><span class="lines">@@ -216,12 +216,12 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     auto buffered = m_mediaSource-&gt;buffered();
</span><del>-    size_t pos = buffered-&gt;find(m_currentTime.toDouble());
</del><ins>+    size_t pos = buffered-&gt;find(m_currentTime);
</ins><span class="cx">     if (pos == notFound)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     bool ignoreError;
</span><del>-    m_currentTime = std::min(m_duration, MediaTime::createWithDouble(buffered-&gt;end(pos, ignoreError)));
</del><ins>+    m_currentTime = std::min(m_duration, buffered-&gt;end(pos, ignoreError));
</ins><span class="cx">     m_player-&gt;timeChanged();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>