[MSE] Bug 26316 - Changed duration change algorithm to avoid open transition on endOfStream().
authorAaron Colwell <acolwell@chromium.org>
Thu, 24 Jul 2014 14:01:00 -0700
changeset 377 b3f086e62b53
parent 376 13056a200b38
child 378 c63fe313d13a
[MSE] Bug 26316 - Changed duration change algorithm to avoid open transition on endOfStream().
media-source/media-source-respec.html
media-source/media-source.html
media-source/media-source.js
--- a/media-source/media-source-respec.html	Thu Jul 24 13:12:27 2014 -0700
+++ b/media-source/media-source-respec.html	Thu Jul 24 14:01:00 2014 -0700
@@ -758,7 +758,9 @@
             <li>If the current value of <a def-id="duration"></a> is equal to <var>new duration</var>, then return.</li>
             <li>Set <var>old duration</var> to the current value of <a def-id="duration"></a>.
             <li>Update <a def-id="duration"></a> to <var>new duration</var>.</li>
-            <li>If the <var>new duration</var> is less than <var>old duration</var>, then call <a href="#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end">remove</a>(<var>new duration</var>, <var>old duration</var>)</code> on all objects in <a def-id="sourceBuffers"></a>.
+            <li>If the <var>new duration</var> is less than <var>old duration</var>, then run the
+              <a def-id="range-removal"></a> algorithm with <var>new duration</var> and
+              <var>old duration</var> as the start and end of the removal range.</li>
               <p class="note">This preserves audio frames and text cues that start before and end after the <a def-id="duration"></a>.</p></li>
             <li>If a user agent is unable to partially render audio frames or text cues that start before and end after the <a def-id="duration"></a>, then run the following steps:
               <ol>
@@ -1034,13 +1036,7 @@
 	        <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="sourceopen"></a> at the <a def-id="parent-media-source"></a> .</li>
               </ol>
             </li>
-            <li>Set the <a def-id="updating"></a> attribute to true.</li>
-            <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="updatestart"></a> at this <a>SourceBuffer</a> object.</li>
-            <li>Return control to the caller and run the rest of the steps asynchronously.</li>
-            <li>Run the <a def-id="coded-frame-removal-algorithm"></a> with <var>start</var> and <var>end</var> as the start and end of the removal range.</li>
-            <li>Set the <a def-id="updating"></a> attribute to false.</li>
-            <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="update"></a> at this <a>SourceBuffer</a> object.</li>
-            <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="updateend"></a> at this <a>SourceBuffer</a> object.</li>
+            <li>Run the <a def-id="range-removal"></a> algorithm with <var>start</var> and <var>end</var> as the start and end of the removal range.</li>
        </ol>
 
         </dd>
@@ -1331,6 +1327,22 @@
           </ol>
         </section>
 
+        <section  id="sourcebuffer-range-removal">
+          <h4>Range Removal</h4>
+          <p>Follow these steps when a caller needs to initiate a JavaScript visible range removal
+            operation that blocks other SourceBuffer updates:</p>
+          <ol>
+            <li>Let <var>start</var> equal the starting <a def-id="presentation-timestamp"></a> for the removal range.</li>
+            <li>Let <var>end</var> equal the end <a def-id="presentation-timestamp"></a> for the removal range.</li>
+            <li>Set the <a def-id="updating"></a> attribute to true.</li>
+            <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="updatestart"></a> at this <a>SourceBuffer</a> object.</li>
+            <li>Return control to the caller and run the rest of the steps asynchronously.</li>
+            <li>Run the <a def-id="coded-frame-removal-algorithm"></a> with <var>start</var> and <var>end</var> as the start and end of the removal range.</li>
+            <li>Set the <a def-id="updating"></a> attribute to false.</li>
+            <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="update"></a> at this <a>SourceBuffer</a> object.</li>
+            <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="updateend"></a> at this <a>SourceBuffer</a> object.</li>
+          </ol>
+        </section>
         <section id="sourcebuffer-init-segment-received">
           <h4>Initialization Segment Received</h4>
           <p>The following steps are run when the <a def-id="segment-parser-loop"></a> successfully parses a complete <a def-id="init-segment"></a>:</p>
@@ -2519,6 +2531,8 @@
             <td>
               <ul>
                 <li>Bug 26345 - Make activeSourceBuffers order match sourceBuffers order.</li>
+                <li>Bug 26316 - Changed duration change algorithm to avoid open transition on
+                  endOfStream().</li>
               </ul>
             </td>
           </tr>
--- a/media-source/media-source.html	Thu Jul 24 13:12:27 2014 -0700
+++ b/media-source/media-source.html	Thu Jul 24 14:01:00 2014 -0700
@@ -406,7 +406,7 @@
   </p>
   <h1 class="title p-name" id="title" property="dcterms:title">Media Source Extensions</h1>
   
-  <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-07-25T03:09:47.000Z" id="w3c-editor-s-draft-24-july-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-07-24">24 July 2014</time></h2>
+  <h2 property="dcterms:issued" datatype="xsd:dateTime" content="2014-07-25T03:58:45.000Z" id="w3c-editor-s-draft-24-july-2014"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2014-07-24">24 July 2014</time></h2>
   <dl>
     
       <dt>This version:</dt>
@@ -549,7 +549,7 @@
       
     
   
-</section><section id="toc"><h2 class="introductory" aria-level="1" role="heading" id="h2_toc">Table of Contents</h2><ul class="toc" role="directory" id="respecContents"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a><ul class="toc"><li class="tocline"><a href="#goals" class="tocxref"><span class="secno">1.1 </span>Goals</a></li><li class="tocline"><a href="#definitions" class="tocxref"><span class="secno">1.2 </span>Definitions</a></li></ul></li><li class="tocline"><a href="#mediasource" class="tocxref"><span class="secno">2. </span>MediaSource Object</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">2.1 </span>Attributes</a></li><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">2.2 </span>Methods</a></li><li class="tocline"><a href="#mediasource-events" class="tocxref"><span class="secno">2.3 </span>Event Summary</a></li><li class="tocline"><a href="#mediasource-algorithms" class="tocxref"><span class="secno">2.4 </span>Algorithms</a><ul class="toc"><li class="tocline"><a href="#mediasource-attach" class="tocxref"><span class="secno">2.4.1 </span>Attaching to a media element</a></li><li class="tocline"><a href="#mediasource-detach" class="tocxref"><span class="secno">2.4.2 </span>Detaching from a media element</a></li><li class="tocline"><a href="#mediasource-seeking" class="tocxref"><span class="secno">2.4.3 </span>Seeking</a></li><li class="tocline"><a href="#buffer-monitoring" class="tocxref"><span class="secno">2.4.4 </span>SourceBuffer Monitoring</a></li><li class="tocline"><a href="#active-source-buffer-changes" class="tocxref"><span class="secno">2.4.5 </span>Changes to selected/enabled track state</a></li><li class="tocline"><a href="#duration-change-algorithm" class="tocxref"><span class="secno">2.4.6 </span>Duration change</a></li><li class="tocline"><a href="#end-of-stream-algorithm" class="tocxref"><span class="secno">2.4.7 </span>End of stream algorithm</a></li></ul></li></ul></li><li class="tocline"><a href="#sourcebuffer" class="tocxref"><span class="secno">3. </span>SourceBuffer Object</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">3.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">3.2 </span>Methods</a></li><li class="tocline"><a href="#track-buffers" class="tocxref"><span class="secno">3.3 </span>Track Buffers</a></li><li class="tocline"><a href="#sourcebuffer-events" class="tocxref"><span class="secno">3.4 </span>Event Summary</a></li><li class="tocline"><a href="#sourcebuffer-algorithms" class="tocxref"><span class="secno">3.5 </span>Algorithms</a><ul class="toc"><li class="tocline"><a href="#sourcebuffer-segment-parser-loop" class="tocxref"><span class="secno">3.5.1 </span>Segment Parser Loop</a></li><li class="tocline"><a href="#sourcebuffer-reset-parser-state" class="tocxref"><span class="secno">3.5.2 </span>Reset Parser State</a></li><li class="tocline"><a href="#sourcebuffer-append-error" class="tocxref"><span class="secno">3.5.3 </span>Append Error Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-prepare-append" class="tocxref"><span class="secno">3.5.4 </span>Prepare Append Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-buffer-append" class="tocxref"><span class="secno">3.5.5 </span>Buffer Append Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-stream-append-loop" class="tocxref"><span class="secno">3.5.6 </span>Stream Append Loop</a></li><li class="tocline"><a href="#sourcebuffer-init-segment-received" class="tocxref"><span class="secno">3.5.7 </span>Initialization Segment Received</a></li><li class="tocline"><a href="#sourcebuffer-default-track-language" class="tocxref"><span class="secno">3.5.8 </span>Default track language</a></li><li class="tocline"><a href="#sourcebuffer-default-track-kinds" class="tocxref"><span class="secno">3.5.9 </span>Default track kinds</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-processing" class="tocxref"><span class="secno">3.5.10 </span>Coded Frame Processing</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-removal" class="tocxref"><span class="secno">3.5.11 </span>Coded Frame Removal Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-eviction" class="tocxref"><span class="secno">3.5.12 </span>Coded Frame Eviction Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-audio-splice-frame-algorithm" class="tocxref"><span class="secno">3.5.13 </span>Audio Splice Frame Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-audio-splice-rendering-algorithm" class="tocxref"><span class="secno">3.5.14 </span>Audio Splice Rendering Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-text-splice-frame-algorithm" class="tocxref"><span class="secno">3.5.15 </span>Text Splice Frame Algorithm</a></li></ul></li></ul></li><li class="tocline"><a href="#sourcebufferlist" class="tocxref"><span class="secno">4. </span>SourceBufferList Object</a><ul class="toc"><li class="tocline"><a href="#attributes-2" class="tocxref"><span class="secno">4.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-2" class="tocxref"><span class="secno">4.2 </span>Methods</a></li><li class="tocline"><a href="#sourcebufferlist-events" class="tocxref"><span class="secno">4.3 </span>Event Summary</a></li></ul></li><li class="tocline"><a href="#videoplaybackquality" class="tocxref"><span class="secno">5. </span>VideoPlaybackQuality Object</a><ul class="toc"><li class="tocline"><a href="#attributes-3" class="tocxref"><span class="secno">5.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#trackdefault" class="tocxref"><span class="secno">6. </span>TrackDefault Object</a><ul class="toc"><li class="tocline"><a href="#constructors" class="tocxref"><span class="secno">6.1 </span>Constructors</a></li><li class="tocline"><a href="#attributes-4" class="tocxref"><span class="secno">6.2 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#trackdefaultlist" class="tocxref"><span class="secno">7. </span>TrackDefaultList Object</a><ul class="toc"><li class="tocline"><a href="#constructors-1" class="tocxref"><span class="secno">7.1 </span>Constructors</a></li><li class="tocline"><a href="#attributes-5" class="tocxref"><span class="secno">7.2 </span>Attributes</a></li><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">7.3 </span>Methods</a></li></ul></li><li class="tocline"><a href="#url" class="tocxref"><span class="secno">8. </span>URL Object Extensions</a><ul class="toc"><li class="tocline"><a href="#methods-4" class="tocxref"><span class="secno">8.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#htmlmediaelement-extensions" class="tocxref"><span class="secno">9. </span>HTMLMediaElement Extensions</a></li><li class="tocline"><a href="#htmlvideoelement-extensions" class="tocxref"><span class="secno">10. </span>HTMLVideoElement Extensions</a><ul class="toc"><li class="tocline"><a href="#methods-5" class="tocxref"><span class="secno">10.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#audio-track-extensions" class="tocxref"><span class="secno">11. </span>AudioTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-6" class="tocxref"><span class="secno">11.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#video-track-extensions" class="tocxref"><span class="secno">12. </span>VideoTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-7" class="tocxref"><span class="secno">12.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#text-track-extensions" class="tocxref"><span class="secno">13. </span>TextTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-8" class="tocxref"><span class="secno">13.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#byte-stream-formats" class="tocxref"><span class="secno">14. </span>Byte Stream Formats</a></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">15. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">16. </span>Acknowledgments</a></li><li class="tocline"><a href="#revision-history" class="tocxref"><span class="secno">17. </span>Revision History</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">A. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">A.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">A.2 </span>Informative references</a></li></ul></li></ul></section>
+</section><section id="toc"><h2 class="introductory" aria-level="1" role="heading" id="h2_toc">Table of Contents</h2><ul class="toc" role="directory" id="respecContents"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a><ul class="toc"><li class="tocline"><a href="#goals" class="tocxref"><span class="secno">1.1 </span>Goals</a></li><li class="tocline"><a href="#definitions" class="tocxref"><span class="secno">1.2 </span>Definitions</a></li></ul></li><li class="tocline"><a href="#mediasource" class="tocxref"><span class="secno">2. </span>MediaSource Object</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">2.1 </span>Attributes</a></li><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">2.2 </span>Methods</a></li><li class="tocline"><a href="#mediasource-events" class="tocxref"><span class="secno">2.3 </span>Event Summary</a></li><li class="tocline"><a href="#mediasource-algorithms" class="tocxref"><span class="secno">2.4 </span>Algorithms</a><ul class="toc"><li class="tocline"><a href="#mediasource-attach" class="tocxref"><span class="secno">2.4.1 </span>Attaching to a media element</a></li><li class="tocline"><a href="#mediasource-detach" class="tocxref"><span class="secno">2.4.2 </span>Detaching from a media element</a></li><li class="tocline"><a href="#mediasource-seeking" class="tocxref"><span class="secno">2.4.3 </span>Seeking</a></li><li class="tocline"><a href="#buffer-monitoring" class="tocxref"><span class="secno">2.4.4 </span>SourceBuffer Monitoring</a></li><li class="tocline"><a href="#active-source-buffer-changes" class="tocxref"><span class="secno">2.4.5 </span>Changes to selected/enabled track state</a></li><li class="tocline"><a href="#duration-change-algorithm" class="tocxref"><span class="secno">2.4.6 </span>Duration change</a></li><li class="tocline"><a href="#end-of-stream-algorithm" class="tocxref"><span class="secno">2.4.7 </span>End of stream algorithm</a></li></ul></li></ul></li><li class="tocline"><a href="#sourcebuffer" class="tocxref"><span class="secno">3. </span>SourceBuffer Object</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">3.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">3.2 </span>Methods</a></li><li class="tocline"><a href="#track-buffers" class="tocxref"><span class="secno">3.3 </span>Track Buffers</a></li><li class="tocline"><a href="#sourcebuffer-events" class="tocxref"><span class="secno">3.4 </span>Event Summary</a></li><li class="tocline"><a href="#sourcebuffer-algorithms" class="tocxref"><span class="secno">3.5 </span>Algorithms</a><ul class="toc"><li class="tocline"><a href="#sourcebuffer-segment-parser-loop" class="tocxref"><span class="secno">3.5.1 </span>Segment Parser Loop</a></li><li class="tocline"><a href="#sourcebuffer-reset-parser-state" class="tocxref"><span class="secno">3.5.2 </span>Reset Parser State</a></li><li class="tocline"><a href="#sourcebuffer-append-error" class="tocxref"><span class="secno">3.5.3 </span>Append Error Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-prepare-append" class="tocxref"><span class="secno">3.5.4 </span>Prepare Append Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-buffer-append" class="tocxref"><span class="secno">3.5.5 </span>Buffer Append Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-stream-append-loop" class="tocxref"><span class="secno">3.5.6 </span>Stream Append Loop</a></li><li class="tocline"><a href="#sourcebuffer-range-removal" class="tocxref"><span class="secno">3.5.7 </span>Range Removal</a></li><li class="tocline"><a href="#sourcebuffer-init-segment-received" class="tocxref"><span class="secno">3.5.8 </span>Initialization Segment Received</a></li><li class="tocline"><a href="#sourcebuffer-default-track-language" class="tocxref"><span class="secno">3.5.9 </span>Default track language</a></li><li class="tocline"><a href="#sourcebuffer-default-track-kinds" class="tocxref"><span class="secno">3.5.10 </span>Default track kinds</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-processing" class="tocxref"><span class="secno">3.5.11 </span>Coded Frame Processing</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-removal" class="tocxref"><span class="secno">3.5.12 </span>Coded Frame Removal Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-eviction" class="tocxref"><span class="secno">3.5.13 </span>Coded Frame Eviction Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-audio-splice-frame-algorithm" class="tocxref"><span class="secno">3.5.14 </span>Audio Splice Frame Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-audio-splice-rendering-algorithm" class="tocxref"><span class="secno">3.5.15 </span>Audio Splice Rendering Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-text-splice-frame-algorithm" class="tocxref"><span class="secno">3.5.16 </span>Text Splice Frame Algorithm</a></li></ul></li></ul></li><li class="tocline"><a href="#sourcebufferlist" class="tocxref"><span class="secno">4. </span>SourceBufferList Object</a><ul class="toc"><li class="tocline"><a href="#attributes-2" class="tocxref"><span class="secno">4.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-2" class="tocxref"><span class="secno">4.2 </span>Methods</a></li><li class="tocline"><a href="#sourcebufferlist-events" class="tocxref"><span class="secno">4.3 </span>Event Summary</a></li></ul></li><li class="tocline"><a href="#videoplaybackquality" class="tocxref"><span class="secno">5. </span>VideoPlaybackQuality Object</a><ul class="toc"><li class="tocline"><a href="#attributes-3" class="tocxref"><span class="secno">5.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#trackdefault" class="tocxref"><span class="secno">6. </span>TrackDefault Object</a><ul class="toc"><li class="tocline"><a href="#constructors" class="tocxref"><span class="secno">6.1 </span>Constructors</a></li><li class="tocline"><a href="#attributes-4" class="tocxref"><span class="secno">6.2 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#trackdefaultlist" class="tocxref"><span class="secno">7. </span>TrackDefaultList Object</a><ul class="toc"><li class="tocline"><a href="#constructors-1" class="tocxref"><span class="secno">7.1 </span>Constructors</a></li><li class="tocline"><a href="#attributes-5" class="tocxref"><span class="secno">7.2 </span>Attributes</a></li><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">7.3 </span>Methods</a></li></ul></li><li class="tocline"><a href="#url" class="tocxref"><span class="secno">8. </span>URL Object Extensions</a><ul class="toc"><li class="tocline"><a href="#methods-4" class="tocxref"><span class="secno">8.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#htmlmediaelement-extensions" class="tocxref"><span class="secno">9. </span>HTMLMediaElement Extensions</a></li><li class="tocline"><a href="#htmlvideoelement-extensions" class="tocxref"><span class="secno">10. </span>HTMLVideoElement Extensions</a><ul class="toc"><li class="tocline"><a href="#methods-5" class="tocxref"><span class="secno">10.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#audio-track-extensions" class="tocxref"><span class="secno">11. </span>AudioTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-6" class="tocxref"><span class="secno">11.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#video-track-extensions" class="tocxref"><span class="secno">12. </span>VideoTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-7" class="tocxref"><span class="secno">12.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#text-track-extensions" class="tocxref"><span class="secno">13. </span>TextTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-8" class="tocxref"><span class="secno">13.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#byte-stream-formats" class="tocxref"><span class="secno">14. </span>Byte Stream Formats</a></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">15. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">16. </span>Acknowledgments</a></li><li class="tocline"><a href="#revision-history" class="tocxref"><span class="secno">17. </span>Revision History</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">A. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">A.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">A.2 </span>Informative references</a></li></ul></li></ul></section>
 
 
     <section id="introduction" typeof="bibo:Chapter" resource="#introduction" rel="bibo:Chapter">
@@ -1141,8 +1141,10 @@
             <li>If the current value of <code><a href="#widl-MediaSource-duration">duration</a></code> is equal to <var>new duration</var>, then return.</li>
             <li>Set <var>old duration</var> to the current value of <code><a href="#widl-MediaSource-duration">duration</a></code>.
             </li><li>Update <code><a href="#widl-MediaSource-duration">duration</a></code> to <var>new duration</var>.</li>
-            <li>If the <var>new duration</var> is less than <var>old duration</var>, then call <a href="#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end">remove</a>(<var>new duration</var>, <var>old duration</var>) on all objects in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code>.
-              <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_14"><span>Note</span></div><p class="">This preserves audio frames and text cues that start before and end after the <code><a href="#widl-MediaSource-duration">duration</a></code>.</p></div></li>
+            <li>If the <var>new duration</var> is less than <var>old duration</var>, then run the
+              <a href="#sourcebuffer-range-removal">range removal</a> algorithm with <var>new duration</var> and
+              <var>old duration</var> as the start and end of the removal range.</li>
+              <div class="note"><div class="note-title" aria-level="4" role="heading" id="h_note_14"><span>Note</span></div><p class="">This preserves audio frames and text cues that start before and end after the <code><a href="#widl-MediaSource-duration">duration</a></code>.</p></div>
             <li>If a user agent is unable to partially render audio frames or text cues that start before and end after the <code><a href="#widl-MediaSource-duration">duration</a></code>, then run the following steps:
               <ol>
                 <li>Update <var>new duration</var> to the highest end time reported by the <code><a href="#widl-SourceBuffer-buffered">buffered</a></code> attribute across all <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> objects in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code>.</li>
@@ -1404,13 +1406,7 @@
 	        <li><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-sourceopen">sourceopen</a></code> at the <a href="#parent-media-source">parent media source</a> .</li>
               </ol>
             </li>
-            <li>Set the <code><a href="#widl-SourceBuffer-updating">updating</a></code> attribute to true.</li>
-            <li><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-updatestart">updatestart</a></code> at this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
-            <li>Return control to the caller and run the rest of the steps asynchronously.</li>
-            <li>Run the <a href="#sourcebuffer-coded-frame-removal">coded frame removal algorithm</a> with <var>start</var> and <var>end</var> as the start and end of the removal range.</li>
-            <li>Set the <code><a href="#widl-SourceBuffer-updating">updating</a></code> attribute to false.</li>
-            <li><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-update">update</a></code> at this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
-            <li><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-updateend">updateend</a></code> at this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
+            <li>Run the <a href="#sourcebuffer-range-removal">range removal</a> algorithm with <var>start</var> and <var>end</var> as the start and end of the removal range.</li>
        </ol></dd></dl></section>
 
       <section id="track-buffers" typeof="bibo:Chapter" resource="#track-buffers" rel="bibo:Chapter">
@@ -1684,8 +1680,24 @@
           </ol>
         </section>
 
+        <section id="sourcebuffer-range-removal" typeof="bibo:Chapter" resource="#sourcebuffer-range-removal" rel="bibo:Chapter">
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-range-removal"><span class="secno">3.5.7 </span>Range Removal</h4>
+          <p>Follow these steps when a caller needs to initiate a JavaScript visible range removal
+            operation that blocks other SourceBuffer updates:</p>
+          <ol>
+            <li>Let <var>start</var> equal the starting <a href="#presentation-timestamp">presentation timestamp</a> for the removal range.</li>
+            <li>Let <var>end</var> equal the end <a href="#presentation-timestamp">presentation timestamp</a> for the removal range.</li>
+            <li>Set the <code><a href="#widl-SourceBuffer-updating">updating</a></code> attribute to true.</li>
+            <li><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-updatestart">updatestart</a></code> at this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
+            <li>Return control to the caller and run the rest of the steps asynchronously.</li>
+            <li>Run the <a href="#sourcebuffer-coded-frame-removal">coded frame removal algorithm</a> with <var>start</var> and <var>end</var> as the start and end of the removal range.</li>
+            <li>Set the <code><a href="#widl-SourceBuffer-updating">updating</a></code> attribute to false.</li>
+            <li><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-update">update</a></code> at this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
+            <li><a href="http://www.w3.org/TR/html5/webappapis.html#queue-a-task">Queue a task</a> to <a href="http://www.w3.org/TR/html5/webappapis.html#fire-a-simple-event">fire a simple event</a> named <code><a href="#dom-evt-updateend">updateend</a></code> at this <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> object.</li>
+          </ol>
+        </section>
         <section id="sourcebuffer-init-segment-received" typeof="bibo:Chapter" resource="#sourcebuffer-init-segment-received" rel="bibo:Chapter">
-          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-init-segment-received"><span class="secno">3.5.7 </span>Initialization Segment Received</h4>
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-init-segment-received"><span class="secno">3.5.8 </span>Initialization Segment Received</h4>
           <p>The following steps are run when the <a href="#sourcebuffer-segment-parser-loop">segment parser loop</a> successfully parses a complete <a href="#init-segment">initialization segment</a>:</p>
           <p>Each SourceBuffer object has an internal <dfn id="first-init-segment-flag">first initialization segment flag</dfn> that tracks whether the first <a href="#init-segment">initialization segment</a> has been appended. This flag is set to false when the SourceBuffer is created and updated by the algorithm below.</p>
           <ol>
@@ -1909,7 +1921,7 @@
         </section>
 
         <section id="sourcebuffer-default-track-language" typeof="bibo:Chapter" resource="#sourcebuffer-default-track-language" rel="bibo:Chapter">
-          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-default-track-language"><span class="secno">3.5.8 </span>Default track language</h4>
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-default-track-language"><span class="secno">3.5.9 </span>Default track language</h4>
           <p>The following steps are run when the <a href="#sourcebuffer-init-segment-received">initialization segment received algorithm</a> needs
             to determine what the default language for a new track should be. This algorithm is initialized
             with <var>byteStreamTrackID</var> and <var>type</var> parameters when invoked by the
@@ -1934,7 +1946,7 @@
         </section>
 
         <section id="sourcebuffer-default-track-kinds" typeof="bibo:Chapter" resource="#sourcebuffer-default-track-kinds" rel="bibo:Chapter">
-          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-default-track-kinds"><span class="secno">3.5.9 </span>Default track kinds</h4>
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-default-track-kinds"><span class="secno">3.5.10 </span>Default track kinds</h4>
           <p>The following steps are run when the <a href="#sourcebuffer-init-segment-received">initialization segment received algorithm</a> needs
             to determine what the default kinds for a new track should be. This algorithm is initialized
             with <var>byteStreamTrackID</var> and <var>type</var> parameters when invoked by the
@@ -1959,7 +1971,7 @@
         </section>
 
         <section id="sourcebuffer-coded-frame-processing" typeof="bibo:Chapter" resource="#sourcebuffer-coded-frame-processing" rel="bibo:Chapter">
-          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-coded-frame-processing"><span class="secno">3.5.10 </span>Coded Frame Processing</h4>
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-coded-frame-processing"><span class="secno">3.5.11 </span>Coded Frame Processing</h4>
           <p>When complete <a href="#coded-frame">coded frames</a> have been parsed by the <a href="#sourcebuffer-segment-parser-loop">segment parser loop</a> then the following steps are run:</p>
           <ol>
             <li>
@@ -2169,7 +2181,7 @@
         </section>
 
         <section id="sourcebuffer-coded-frame-removal" typeof="bibo:Chapter" resource="#sourcebuffer-coded-frame-removal" rel="bibo:Chapter">
-          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-coded-frame-removal"><span class="secno">3.5.11 </span>Coded Frame Removal Algorithm</h4>
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-coded-frame-removal"><span class="secno">3.5.12 </span>Coded Frame Removal Algorithm</h4>
           <p>Follow these steps when <a href="#coded-frame">coded frames</a> for a specific time range need to be removed from the SourceBuffer:</p>
           <ol>
             <li>Let <var>start</var> be the starting <a href="#presentation-timestamp">presentation timestamp</a> for the removal range.</li>
@@ -2200,7 +2212,7 @@
         </section>
 
         <section id="sourcebuffer-coded-frame-eviction" typeof="bibo:Chapter" resource="#sourcebuffer-coded-frame-eviction" rel="bibo:Chapter">
-          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-coded-frame-eviction"><span class="secno">3.5.12 </span>Coded Frame Eviction Algorithm</h4>
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-coded-frame-eviction"><span class="secno">3.5.13 </span>Coded Frame Eviction Algorithm</h4>
           <p>This algorithm is run to free up space in this source buffer when new data is appended.</p>
           <ol>
             <li>Let <var>new data</var> equal the data that is about to be appended to this SourceBuffer.</li>
@@ -2217,7 +2229,7 @@
         </section>
 
         <section id="sourcebuffer-audio-splice-frame-algorithm" typeof="bibo:Chapter" resource="#sourcebuffer-audio-splice-frame-algorithm" rel="bibo:Chapter">
-          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-audio-splice-frame-algorithm"><span class="secno">3.5.13 </span>Audio Splice Frame Algorithm</h4>
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-audio-splice-frame-algorithm"><span class="secno">3.5.14 </span>Audio Splice Frame Algorithm</h4>
           <p>Follow these steps when the <a href="#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a> needs to generate a splice frame for two overlapping audio
             <a href="#coded-frame">coded frames</a>:</p>
           <ol>
@@ -2287,7 +2299,7 @@
           </ol>
         </section>
         <section id="sourcebuffer-audio-splice-rendering-algorithm" typeof="bibo:Chapter" resource="#sourcebuffer-audio-splice-rendering-algorithm" rel="bibo:Chapter">
-          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-audio-splice-rendering-algorithm"><span class="secno">3.5.14 </span>Audio Splice Rendering Algorithm</h4>
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-audio-splice-rendering-algorithm"><span class="secno">3.5.15 </span>Audio Splice Rendering Algorithm</h4>
           <p>The following steps are run when a spliced frame, generated by the <a href="#sourcebuffer-audio-splice-frame-algorithm">audio splice frame algorithm</a>, needs to be rendered by the
             media element:</p>
           <ol>
@@ -2320,7 +2332,7 @@
           </div></div>
         </section>
         <section id="sourcebuffer-text-splice-frame-algorithm" typeof="bibo:Chapter" resource="#sourcebuffer-text-splice-frame-algorithm" rel="bibo:Chapter">
-          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-text-splice-frame-algorithm"><span class="secno">3.5.15 </span>Text Splice Frame Algorithm</h4>
+          <h4 aria-level="3" role="heading" id="h4_sourcebuffer-text-splice-frame-algorithm"><span class="secno">3.5.16 </span>Text Splice Frame Algorithm</h4>
           <p>Follow these steps when the <a href="#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a> needs to generate a splice frame for two overlapping timed text
             <a href="#coded-frame">coded frames</a>:</p>
           <ol>
@@ -2840,6 +2852,8 @@
             <td>
               <ul>
                 <li>Bug 26345 - Make activeSourceBuffers order match sourceBuffers order.</li>
+                <li>Bug 26316 - Changed "duration change" algorithm to avoid "open" transition on
+                  endOfStream().</li>
               </ul>
             </td>
           </tr>
--- a/media-source/media-source.js	Thu Jul 24 13:12:27 2014 -0700
+++ b/media-source/media-source.js	Thu Jul 24 14:01:00 2014 -0700
@@ -219,6 +219,7 @@
     'stream-append-loop': { func: link_helper, fragment: '#sourcebuffer-stream-append-loop', link_text: 'stream append loop', },
     'prepare-append': { func: link_helper, fragment: '#sourcebuffer-prepare-append', link_text: 'prepare append', },
     'buffer-append': { func: link_helper, fragment: '#sourcebuffer-buffer-append', link_text: 'buffer append', },
+    'range-removal': { func: link_helper, fragment: '#sourcebuffer-range-removal', link_text: 'range removal', },
     'init-segment-received-algorithm': { func: link_helper, fragment: '#sourcebuffer-init-segment-received', link_text: 'initialization segment received algorithm', },
     'coded-frame-processing-algorithm': { func: link_helper, fragment: '#sourcebuffer-coded-frame-processing', link_text: 'coded frame processing algorithm', },
     'coded-frame-removal-algorithm': { func: link_helper, fragment: '#sourcebuffer-coded-frame-removal', link_text: 'coded frame removal algorithm', },