More pre-LC bug fixes.
authorAaron Colwell <acolwell@chromium.org>
Wed, 05 Jun 2013 07:34:10 -0700
changeset 132 63675668846c
parent 131 69dbfb8baca8
child 133 1032b19ff6e9
More pre-LC bug fixes.

Bug 22139 - Added a note clarifying that byte stream specs aren't defining new storage formats.
Bug 22148 - Added playbackJitter metric
Bug 22134 - Added minimal number of SourceBuffers requirements.
Bug 22115 - Make algorithm abort text consistent.
Bug 22113 - Address typos.
Bug 22065 - Fix infinite loop in coded frame processing algorithm.
media-source/media-source-respec.html
media-source/media-source.html
media-source/media-source.js
--- a/media-source/media-source-respec.html	Tue Jun 04 08:01:41 2013 -0700
+++ b/media-source/media-source-respec.html	Wed Jun 05 07:34:10 2013 -0700
@@ -168,6 +168,15 @@
               <a def-id="coded-frame-processing-algorithm"></a> and <a def-id="abort"></a> calls trigger the start of a new coded frame sequence.</p>
           </dd>
 
+          <dt id="display-duration-error">Display Duration Error</dt>
+          <dd>
+            <p>The display duration error for a frame is computed using the following steps:</p>
+            <ol>
+              <li>Let <var>Ei</var> equal the desired duration frame i should spend on the screen (to nearest microsecond)</li>
+              <li>Let <var>Ai</var> equal the actual duration frame i spent on the screen (if the frame is never displayed to the user (i.e. dropped) , then let <var>Ai</var> equal 0).</li>
+              <li>Let <var>display duration error</var> equal the absolute value of (<var>Ei</var> - <var>Ai</var>).</li>
+            </ol>
+          </dd>
           <dt id="init-segment">Initialization Segment</dt>
           <dd>
 	    <p>A sequence of bytes that contain all of the initialization information required to decode a sequence of <a def-id="media-segments"></a>. This includes codec initialization data, <a def-id="track-id"></a> mappings for multiplexed segments, and timestamp offsets (e.g. edit lists).</p>
@@ -282,7 +291,12 @@
         <dt>SourceBuffer addSourceBuffer(DOMString type)</dt>
         <dd>
           <p>Adds a new <a>SourceBuffer</a> to <a def-id="sourceBuffers"></a>.</p>
-
+          <p>Implementations must support at least 1 MediaSource object with the following <a>SourceBuffer</a> configurations. Anything beyond this is a quality of implementation issue.
+            <ul>
+              <li>A single SourceBuffer with 1 audio track and/or 1 video track.</li>
+              <li>Two SourceBuffers with one handling a single audio track and the other handling a single video track.</li>
+            </ul>
+          </p>
           <ol class="method-algorithm">
             <li>If <var>type</var> is null or an empty string then throw an <a def-id="invalid-access-err"></a> exception and abort these steps.</li>
             <li>If <var>type</var> contains a MIME type that is not supported or contains a MIME type that is not supported with the types specified for the other <a>SourceBuffer</a> objects in <a def-id="sourceBuffers"></a>, then throw a <a def-id="not-supported-err"></a> exception and abort these steps.</li>
@@ -308,7 +322,7 @@
             <li>If <var>sourceBuffer</var> specifies an object that is not in <a def-id="sourceBuffers"></a> then throw a <a def-id="not-found-err"></a> exception and abort these steps.</li>
             <li>If the <var>sourceBuffer</var>.<a def-id="updating"></a> attribute equals true, then run the following steps:
               <ol>
-                <li>Abort the <a def-id="stream-append-loop"></a> algorithm if it is running.</li>
+                <li>Abort the <a def-id="buffer-append"></a> and <a def-id="stream-append-loop"></a> algorithms if they are running.</li>
                 <li>Set the <var>sourceBuffer</var>.<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="updateabort"></a> at <var>sourceBuffer</var>.</li>
                 <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="updateend"></a> at <var>sourceBuffer</var>.</li>
@@ -730,7 +744,7 @@
         <dt>sequence</dt>
         <dd>
           <p>Media segments will be treated as adjacent in time independent of the timestamps in the media segment. Coded frames in a new media segment will be placed immediately after the coded
-            frames in the previous media segment. The <a def-id="timestampOffset"></a> attribute will be updated if a new offset is need to make the new media segments adjacent to the previous media segment.
+            frames in the previous media segment. The <a def-id="timestampOffset"></a> attribute will be updated if a new offset is needed to make the new media segments adjacent to the previous media segment.
             Setting the <a def-id="timestampOffset"></a> attribute in <a def-id="AppendMode-sequence"></a> mode allows a media segment to be placed at a specific position in the timeline without any knowledge
             of the timestamps in the media segment.
           </p>
@@ -922,8 +936,7 @@
             <li>If the <a def-id="readyState"></a> attribute of the <a def-id="parent-media-source"></a> is not in the <a def-id="open"></a> state then throw an <a def-id="invalid-state-err"></a> exception and abort these steps.</li>
             <li>If the <a def-id="updating"></a> attribute equals true, then run the following steps:
               <ol>
-                <li>Abort the <a def-id="segment-parser-loop"></a>, <a def-id="buffer-append"></a>, and <a def-id="stream-append-loop"></a> algorithms if
-                  they are running.</li>
+                <li>Abort the <a def-id="buffer-append"></a> and <a def-id="stream-append-loop"></a> algorithms if they are running.</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="updateabort"></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>
@@ -1064,8 +1077,7 @@
             as data is appended and removed.</p>
 
           <p>The <dfn id="sourcebuffer-sequence-start-timestamp">sequence start timestamp</dfn> variable keeps track of the starting timestamp for a new <a def-id="coded-frame-sequence"></a> in the
-            <a def-id="AppendMode-sequence"></a> mode. It is use to handle discontinuities, placing media segments adjacent to  <a def-id="AppendMode-segments"></a> mode appends, and placing media segments in the
-            presentation via <a def-id="timestampOffset"></a>.
+            <a def-id="AppendMode-sequence"></a> mode.
             It is unset when the SourceBuffer object is created and gets updated when the <a def-id="mode"></a> attribute equals <a def-id="AppendMode-sequence"></a> and the
             <a def-id="timestampOffset"></a> attribute is set, or the <a def-id="coded-frame-processing-algorithm"></a> runs.
           </p>
@@ -1145,15 +1157,12 @@
         </section>
 
         <section id="sourcebuffer-append-error">
-          <h4>Append Error</h4>
+          <h4>Append Error Algorithm</h4>
           <p>When an error occurs during an append, run the following steps:</p>
           <ol>
             <li>Run the <a def-id="reset-parser-state-algorithm"></a>.</li>
-            <li>Abort the <a def-id="stream-append-loop"></a> algorithm if it is running.</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="updateerror"></a> at this <a>SourceBuffer</a> object.
-            </li>
+            <li><a def-id="Queue-a-task-to-fire-an-event-named"></a> <a def-id="updateerror"></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>
@@ -1358,12 +1367,11 @@
                   </p>
                 </li>
                 <li>Let <var>frame duration</var> be a double precision floating point representation of the coded frame's duration in seconds.</li>
-                <li>Let <var>discontinuity flag</var> equal false.</li>
                 <li>If <a def-id="mode"></a> equals <a def-id="AppendMode-sequence"></a> and <a def-id="sequence-start-timestamp"></a> is set, then run the following steps:
                   <ol>
                     <li>Set <a def-id="timestampOffset"></a> equal to <a def-id="sequence-start-timestamp"></a> - <var>presentation timestamp</var>.</li>
                     <li>Set <a def-id="highest-presentation-end-timestamp"></a> equal to <a def-id="sequence-start-timestamp"></a>.</li>
-                    <li>Set the <var>discontinuity flag</var> to true.</li>
+                    <li>Set the <a def-id="need-RAP-flag"></a> on all <a def-id="track-buffers"></a> to true.</li>
                     <li>Unset <a def-id="sequence-start-timestamp"></a>.</li>
                   </ol>
                 </li>
@@ -1379,9 +1387,9 @@
                 <li>Let <var>track buffer</var> equal the <a def-id="track-buffer"></a> that the coded frame will be added to.</li>
                 <li>
                   <dl class="switch">
-                    <dt>If <var>discontinuity flag</var> equals true:</dt>
                     <dt>If <a def-id="last-decode-timestamp"></a> for <var>track buffer</var> is set and <var>decode timestamp</var> is less than
                       <a def-id="last-decode-timestamp"></a>:</dt>
+                    <dd>OR</dd>
                     <dt>If <a def-id="last-decode-timestamp"></a> for <var>track buffer</var> is set and the difference between <var>decode timestamp</var> and <a def-id="last-decode-timestamp"></a>
                       is greater than 2 times <a def-id="last-frame-duration"></a>:</dt>
                     <dd>
@@ -1784,6 +1792,11 @@
         <dd>
           <p>The total number of corrupted frames that have been detected.</p>
         </dd>
+
+        <dt>readonly attribute double playbackJitter;</dt>
+        <dd>
+          <p>The sum of all <a def-id="display-duration-errors"></a> for all frames included in the <a def-id="totalVideoFrames"></a> count.</p>
+        </dd>
       </dl>
     </section>
 
@@ -1861,6 +1874,12 @@
         and <a def-id="dropped-video-frame-count"></a> must be updated appropriately.
       </p>
 
+      <p>Each <a def-id="htmlvideoelement"></a> will maintain a <dfn id="display-duration-error-sum">display duration error sum</dfn> variable that keeps
+        track of the sum of all <a def-id="display-duration-errors"></a>. This variable is initialized to 0 when the element is created and whenever the
+        <a def-id="media-element-load-algorithm"></a> is invoked. When a frame causes the <a def-id="total-video-frame-count"></a> to increment, the
+        <a def-id="display-duration-error"></a> for that frame is computed and added to this variable.
+      </p>
+
       <dl title="partial interface HTMLVideoElement" class="idl">
         <dt>readonly attribute VideoPlaybackQuality videoPlaybackQuality</dt>
         <dd>
@@ -1872,6 +1891,7 @@
             <li>Set <var>playbackQuality</var>.<a def-id="totalVideoFrames"></a> to the current value of the <a def-id="total-video-frame-count"></a>.</li>
             <li>Set <var>playbackQuality</var>.<a def-id="droppedVideoFrames"></a> to the current value of the <a def-id="dropped-video-frame-count"></a>.</li>
             <li>Set <var>playbackQuality</var>.<a def-id="corruptedVideoFrames"></a> to the current value of the <a def-id="corrupted-video-frame-count"></a>.</li>
+            <li>Set <var>playbackQuality</var>.<a def-id="playbackJitter"></a> to the current value of the <a def-id="display-duration-error-sum"></a>.</li>
             <li>Return <var>playbackQuality</var>.</li>
           </ol>
         </dd>
@@ -2030,6 +2050,9 @@
     <section id="byte-stream-formats">
       <h2>Byte Stream Formats</h2>
       <p>The bytes provided through <a def-id="appendBuffer"></a> and <a def-id="appendStream"></a> for a <a>SourceBuffer</a> form a logical byte stream. The format of this byte stream depends on the media container format in use and is defined in a byte stream format specification. Byte stream format specifications based on WebM , the ISO Base Media File Format, and MPEG-2 Transport Streams are provided below. These format specifications are intended to be the authoritative source for how data from these containers is formatted and passed to a <a>SourceBuffer</a>. If a <a>MediaSource</a> implementation claims to support any of these container formats, then it must implement the corresponding byte stream format specification described below.</p>
+      <p class="note">The byte stream format specifications below are not intended to define new storage formats. They simply outline the subset of
+        existing storage format structures that implementations of this specification will accept.</p>
+
       <p>This section provides general requirements for all byte stream formats:</p>
       <ul>
         <li>A byte stream format specification must define <a def-id="init-segments"></a> and <a def-id="media-segments"></a>.</li>
@@ -2341,7 +2364,20 @@
         </thead>
         <tbody>
           <tr>
-            <td>01 June 2013</td>
+            <td>05 June 2013</td>
+            <td>
+              <ul>
+                <li>Bug 22139 - Added a note clarifying that byte stream specs aren't defining new storage formats.</li>
+                <li>Bug 22148 - Added playbackJitter metric.</li>
+                <li>Bug 22134 - Added minimal number of SourceBuffers requirements.</li>
+                <li>Bug 22115 - Make algorithm abort text consistent.</li>
+                <li>Bug 22113 - Address typos.</li>
+                <li>Bug 22065 - Fix infinite loop in coded frame processing algorithm.</li>
+              </ul>
+            </td>
+          </tr>
+          <tr>
+            <td><a href="https://dvcs.w3.org/hg/html-media/raw-file/1ac9c2205a7b/media-source/media-source.html">01 June 2013</a></td>
             <td>
               <ul>
                 <li>Bug 21431 - Updated coded frame processing algorithm for text splicing.</li>
--- a/media-source/media-source.html	Tue Jun 04 08:01:41 2013 -0700
+++ b/media-source/media-source.html	Wed Jun 05 07:34:10 2013 -0700
@@ -432,7 +432,7 @@
   </p>
   <h1 class="title" id="title">Media Source Extensions</h1>
   
-  <h2 id="w3c-editor-s-draft-01-june-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 01 June 2013</h2>
+  <h2 id="w3c-editor-s-draft-05-june-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 05 June 2013</h2>
   <dl>
     
       <dt>This version:</dt>
@@ -549,7 +549,7 @@
       
     
   
-</section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><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</a></li><li class="tocline"><a href="#sourcebuffer-buffer-append" class="tocxref"><span class="secno">3.5.4 </span>Buffer Append Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-stream-append-loop" class="tocxref"><span class="secno">3.5.5 </span>Stream Append Loop</a></li><li class="tocline"><a href="#sourcebuffer-init-segment-received" class="tocxref"><span class="secno">3.5.6 </span>Initialization Segment Received</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-processing" class="tocxref"><span class="secno">3.5.7 </span>Coded Frame Processing</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-removal" class="tocxref"><span class="secno">3.5.8 </span>Coded Frame Removal Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-eviction" class="tocxref"><span class="secno">3.5.9 </span>Coded Frame Eviction Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-audio-splice-frame-algorithm" class="tocxref"><span class="secno">3.5.10 </span>Audio Splice Frame Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-audio-splice-rendering-algorithm" class="tocxref"><span class="secno">3.5.11 </span>Audio Splice Rendering Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-text-splice-frame-algorithm" class="tocxref"><span class="secno">3.5.12 </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="#url" class="tocxref"><span class="secno">6. </span>URL Object Extensions</a><ul class="toc"><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">6.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#htmlmediaelement-extensions" class="tocxref"><span class="secno">7. </span>HTMLMediaElement Extensions</a></li><li class="tocline"><a href="#htmlvideoelement-extensions" class="tocxref"><span class="secno">8. </span>HTMLVideoElement Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-4" class="tocxref"><span class="secno">8.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#audio-track-extensions" class="tocxref"><span class="secno">9. </span>AudioTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-5" class="tocxref"><span class="secno">9.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#video-track-extensions" class="tocxref"><span class="secno">10. </span>VideoTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-6" class="tocxref"><span class="secno">10.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#text-track-extensions" class="tocxref"><span class="secno">11. </span>TextTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-7" class="tocxref"><span class="secno">11.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#byte-stream-formats" class="tocxref"><span class="secno">12. </span>Byte Stream Formats</a><ul class="toc"><li class="tocline"><a href="#webm" class="tocxref"><span class="secno">12.1 </span>WebM Byte Streams</a><ul class="toc"><li class="tocline"><a href="#webm-init-segments" class="tocxref"><span class="secno">12.1.1 </span>Initialization Segments</a></li><li class="tocline"><a href="#webm-media-segments" class="tocxref"><span class="secno">12.1.2 </span>Media Segments</a></li><li class="tocline"><a href="#webm-random-access-points" class="tocxref"><span class="secno">12.1.3 </span>Random Access Points</a></li></ul></li><li class="tocline"><a href="#iso" class="tocxref"><span class="secno">12.2 </span>ISO Base Media File Format Byte Streams</a><ul class="toc"><li class="tocline"><a href="#iso-init-segments" class="tocxref"><span class="secno">12.2.1 </span>Initialization Segments</a></li><li class="tocline"><a href="#iso-media-segments" class="tocxref"><span class="secno">12.2.2 </span>Media Segments</a></li><li class="tocline"><a href="#iso-random-access-points" class="tocxref"><span class="secno">12.2.3 </span>Random Access Points</a></li></ul></li><li class="tocline"><a href="#mpeg2ts" class="tocxref"><span class="secno">12.3 </span>MPEG-2 Transport Stream Byte Streams</a><ul class="toc"><li class="tocline"><a href="#mpeg2ts-general" class="tocxref"><span class="secno">12.3.1 </span>General</a></li><li class="tocline"><a href="#mpeg2ts-init-segments" class="tocxref"><span class="secno">12.3.2 </span>Initialization Segments</a></li><li class="tocline"><a href="#mpeg2ts-media-segments" class="tocxref"><span class="secno">12.3.3 </span>Media Segments</a></li><li class="tocline"><a href="#mpeg2ts-random-access-points" class="tocxref"><span class="secno">12.3.4 </span>Random Access Points</a></li><li class="tocline"><a href="#mpeg2ts-discontinuities" class="tocxref"><span class="secno">12.3.5 </span>Timestamp Rollover &amp; Discontinuities</a></li></ul></li></ul></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">13. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">14. </span>Acknowledgments</a></li><li class="tocline"><a href="#revision-history" class="tocxref"><span class="secno">15. </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="#informative-references" class="tocxref"><span class="secno">A.1 </span>Informative references</a></li></ul></li></ul></section>
+</section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><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-buffer-append" class="tocxref"><span class="secno">3.5.4 </span>Buffer Append Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-stream-append-loop" class="tocxref"><span class="secno">3.5.5 </span>Stream Append Loop</a></li><li class="tocline"><a href="#sourcebuffer-init-segment-received" class="tocxref"><span class="secno">3.5.6 </span>Initialization Segment Received</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-processing" class="tocxref"><span class="secno">3.5.7 </span>Coded Frame Processing</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-removal" class="tocxref"><span class="secno">3.5.8 </span>Coded Frame Removal Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-coded-frame-eviction" class="tocxref"><span class="secno">3.5.9 </span>Coded Frame Eviction Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-audio-splice-frame-algorithm" class="tocxref"><span class="secno">3.5.10 </span>Audio Splice Frame Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-audio-splice-rendering-algorithm" class="tocxref"><span class="secno">3.5.11 </span>Audio Splice Rendering Algorithm</a></li><li class="tocline"><a href="#sourcebuffer-text-splice-frame-algorithm" class="tocxref"><span class="secno">3.5.12 </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="#url" class="tocxref"><span class="secno">6. </span>URL Object Extensions</a><ul class="toc"><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">6.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#htmlmediaelement-extensions" class="tocxref"><span class="secno">7. </span>HTMLMediaElement Extensions</a></li><li class="tocline"><a href="#htmlvideoelement-extensions" class="tocxref"><span class="secno">8. </span>HTMLVideoElement Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-4" class="tocxref"><span class="secno">8.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#audio-track-extensions" class="tocxref"><span class="secno">9. </span>AudioTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-5" class="tocxref"><span class="secno">9.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#video-track-extensions" class="tocxref"><span class="secno">10. </span>VideoTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-6" class="tocxref"><span class="secno">10.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#text-track-extensions" class="tocxref"><span class="secno">11. </span>TextTrack Extensions</a><ul class="toc"><li class="tocline"><a href="#attributes-7" class="tocxref"><span class="secno">11.1 </span>Attributes</a></li></ul></li><li class="tocline"><a href="#byte-stream-formats" class="tocxref"><span class="secno">12. </span>Byte Stream Formats</a><ul class="toc"><li class="tocline"><a href="#webm" class="tocxref"><span class="secno">12.1 </span>WebM Byte Streams</a><ul class="toc"><li class="tocline"><a href="#webm-init-segments" class="tocxref"><span class="secno">12.1.1 </span>Initialization Segments</a></li><li class="tocline"><a href="#webm-media-segments" class="tocxref"><span class="secno">12.1.2 </span>Media Segments</a></li><li class="tocline"><a href="#webm-random-access-points" class="tocxref"><span class="secno">12.1.3 </span>Random Access Points</a></li></ul></li><li class="tocline"><a href="#iso" class="tocxref"><span class="secno">12.2 </span>ISO Base Media File Format Byte Streams</a><ul class="toc"><li class="tocline"><a href="#iso-init-segments" class="tocxref"><span class="secno">12.2.1 </span>Initialization Segments</a></li><li class="tocline"><a href="#iso-media-segments" class="tocxref"><span class="secno">12.2.2 </span>Media Segments</a></li><li class="tocline"><a href="#iso-random-access-points" class="tocxref"><span class="secno">12.2.3 </span>Random Access Points</a></li></ul></li><li class="tocline"><a href="#mpeg2ts" class="tocxref"><span class="secno">12.3 </span>MPEG-2 Transport Stream Byte Streams</a><ul class="toc"><li class="tocline"><a href="#mpeg2ts-general" class="tocxref"><span class="secno">12.3.1 </span>General</a></li><li class="tocline"><a href="#mpeg2ts-init-segments" class="tocxref"><span class="secno">12.3.2 </span>Initialization Segments</a></li><li class="tocline"><a href="#mpeg2ts-media-segments" class="tocxref"><span class="secno">12.3.3 </span>Media Segments</a></li><li class="tocline"><a href="#mpeg2ts-random-access-points" class="tocxref"><span class="secno">12.3.4 </span>Random Access Points</a></li><li class="tocline"><a href="#mpeg2ts-discontinuities" class="tocxref"><span class="secno">12.3.5 </span>Timestamp Rollover &amp; Discontinuities</a></li></ul></li></ul></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">13. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">14. </span>Acknowledgments</a></li><li class="tocline"><a href="#revision-history" class="tocxref"><span class="secno">15. </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="#informative-references" class="tocxref"><span class="secno">A.1 </span>Informative references</a></li></ul></li></ul></section>
 
 
     <section id="introduction">
@@ -599,6 +599,15 @@
               <a href="#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a> and <code><a href="#widl-SourceBuffer-abort-void">abort()</a></code> calls trigger the start of a new coded frame sequence.</p>
           </dd>
 
+          <dt id="display-duration-error">Display Duration Error</dt>
+          <dd>
+            <p>The display duration error for a frame is computed using the following steps:</p>
+            <ol>
+              <li>Let <var>Ei</var> equal the desired duration frame i should spend on the screen (to nearest microsecond)</li>
+              <li>Let <var>Ai</var> equal the actual duration frame i spent on the screen (if the frame is never displayed to the user (i.e. dropped) , then let <var>Ai</var> equal 0).</li>
+              <li>Let <var>display duration error</var> equal the absolute value of (<var>Ei</var> - <var>Ai</var>).</li>
+            </ol>
+          </dd>
           <dt id="init-segment">Initialization Segment</dt>
           <dd>
 	    <p>A sequence of bytes that contain all of the initialization information required to decode a sequence of <a href="#media-segment">media segments</a>. This includes codec initialization data, <a href="#track-id">Track ID</a> mappings for multiplexed segments, and timestamp offsets (e.g. edit lists).</p>
@@ -704,7 +713,12 @@
           Contains the list of <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> objects associated with this <a href="#idl-def-MediaSource" class="idlType"><code>MediaSource</code></a>. When <code><a href="#widl-MediaSource-readyState">readyState</a></code> equals <code><a href="#idl-def-ReadyState.closed">"closed"</a></code> this list will be empty. Once <code><a href="#widl-MediaSource-readyState">readyState</a></code> transitions to <code><a href="#idl-def-ReadyState.open">"open"</a></code> SourceBuffer objects can be added to this list by using <code><a href="#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type">addSourceBuffer()</a></code>.
         </dd></dl></section><section id="methods"><h3><span class="secno">2.2 </span>Methods</h3><dl class="methods"><dt id="widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type"><code>addSourceBuffer</code></dt><dd>
           <p>Adds a new <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> to <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code>.</p>
-
+          <p>Implementations must support at least 1 MediaSource object with the following <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> configurations. Anything beyond this is a quality of implementation issue.
+            </p><ul>
+              <li>A single SourceBuffer with 1 audio track and/or 1 video track.</li>
+              <li>Two SourceBuffers with one handling a single audio track and the other handling a single video track.</li>
+            </ul>
+          <p></p>
           
         <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">type</td><td class="prmType"><code><code><a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-DOMString" class="idlType">DOMString</a></code></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a></code></div><p>When this method is invoked, the user agent must run the following steps:</p><ol class="method-algorithm">
             <li>If <var>type</var> is null or an empty string then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_access_err">INVALID_ACCESS_ERR</a></code> exception and abort these steps.</li>
@@ -753,7 +767,7 @@
             <li>If <var>sourceBuffer</var> specifies an object that is not in <code><a href="#widl-MediaSource-sourceBuffers">sourceBuffers</a></code> then throw a <code><a href="http://dom.spec.whatwg.org/#dom-domexception-not_found_err">NOT_FOUND_ERR</a></code> exception and abort these steps.</li>
             <li>If the <var>sourceBuffer</var>.<code><a href="#widl-SourceBuffer-updating">updating</a></code> attribute equals true, then run the following steps:
               <ol>
-                <li>Abort the <a href="#sourcebuffer-stream-append-loop">stream append loop</a> algorithm if it is running.</li>
+                <li>Abort the <a href="#sourcebuffer-buffer-append">buffer append </a> and <a href="#sourcebuffer-stream-append-loop">stream append loop</a> algorithms if they are running.</li>
                 <li>Set the <var>sourceBuffer</var>.<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-abort">abort</a></code> at <var>sourceBuffer</var>.</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 <var>sourceBuffer</var>.</li>
@@ -1141,7 +1155,7 @@
             segments can be appended in any order.</p>
         </td></tr><tr><td><code id="idl-def-AppendMode.sequence">sequence</code></td><td>
           <p>Media segments will be treated as adjacent in time independent of the timestamps in the media segment. Coded frames in a new media segment will be placed immediately after the coded
-            frames in the previous media segment. The <code><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> attribute will be updated if a new offset is need to make the new media segments adjacent to the previous media segment.
+            frames in the previous media segment. The <code><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> attribute will be updated if a new offset is needed to make the new media segments adjacent to the previous media segment.
             Setting the <code><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> attribute in <code><a href="#idl-def-AppendMode.sequence">"sequence"</a></code> mode allows a media segment to be placed at a specific position in the timeline without any knowledge
             of the timestamps in the media segment.
           </p>
@@ -1253,8 +1267,7 @@
             <li>If the <code><a href="#widl-MediaSource-readyState">readyState</a></code> attribute of the <a href="#parent-media-source">parent media source</a> is not in the <code><a href="#idl-def-ReadyState.open">"open"</a></code> state then throw an <code><a href="http://dom.spec.whatwg.org/#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
             <li>If the <code><a href="#widl-SourceBuffer-updating">updating</a></code> attribute equals true, then run the following steps:
               <ol>
-                <li>Abort the <a href="#sourcebuffer-segment-parser-loop">segment parser loop</a>, <a href="#sourcebuffer-buffer-append">buffer append </a>, and <a href="#sourcebuffer-stream-append-loop">stream append loop</a> algorithms if
-                  they are running.</li>
+                <li>Abort the <a href="#sourcebuffer-buffer-append">buffer append </a> and <a href="#sourcebuffer-stream-append-loop">stream append loop</a> algorithms if they are running.</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-abort">abort</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>
@@ -1447,8 +1460,7 @@
             as data is appended and removed.</p>
 
           <p>The <dfn id="sourcebuffer-sequence-start-timestamp">sequence start timestamp</dfn> variable keeps track of the starting timestamp for a new <a href="#coded-frame-sequence">coded frame sequence</a> in the
-            <code><a href="#idl-def-AppendMode.sequence">"sequence"</a></code> mode. It is use to handle discontinuities, placing media segments adjacent to  <code><a href="#idl-def-AppendMode.segments">"segments"</a></code> mode appends, and placing media segments in the
-            presentation via <code><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></code>.
+            <code><a href="#idl-def-AppendMode.sequence">"sequence"</a></code> mode.
             It is unset when the SourceBuffer object is created and gets updated when the <code><a href="#widl-SourceBuffer-mode">mode</a></code> attribute equals <code><a href="#idl-def-AppendMode.sequence">"sequence"</a></code> and the
             <code><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> attribute is set, or the <a href="#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a> runs.
           </p>
@@ -1528,15 +1540,12 @@
         </section>
 
         <section id="sourcebuffer-append-error">
-          <h4><span class="secno">3.5.3 </span>Append Error</h4>
+          <h4><span class="secno">3.5.3 </span>Append Error Algorithm</h4>
           <p>When an error occurs during an append, run the following steps:</p>
           <ol>
             <li>Run the <a href="#sourcebuffer-reset-parser-state">reset parser state algorithm</a>.</li>
-            <li>Abort the <a href="#sourcebuffer-stream-append-loop">stream append loop</a> algorithm if it is running.</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-error">error</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-error">error</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>
@@ -1741,12 +1750,11 @@
                   </p></div>
                 </li>
                 <li>Let <var>frame duration</var> be a double precision floating point representation of the coded frame's duration in seconds.</li>
-                <li>Let <var>discontinuity flag</var> equal false.</li>
                 <li>If <code><a href="#widl-SourceBuffer-mode">mode</a></code> equals <code><a href="#idl-def-AppendMode.sequence">"sequence"</a></code> and <var><a href="#sourcebuffer-sequence-start-timestamp">sequence start timestamp</a></var> is set, then run the following steps:
                   <ol>
                     <li>Set <code><a href="#widl-SourceBuffer-timestampOffset">timestampOffset</a></code> equal to <var><a href="#sourcebuffer-sequence-start-timestamp">sequence start timestamp</a></var> - <var>presentation timestamp</var>.</li>
                     <li>Set <var><a href="#sourcebuffer-highest-presentation-end-timestamp">highest presentation end timestamp</a></var> equal to <var><a href="#sourcebuffer-sequence-start-timestamp">sequence start timestamp</a></var>.</li>
-                    <li>Set the <var>discontinuity flag</var> to true.</li>
+                    <li>Set the <var><a href="#need-RAP-flag">need random access point flag</a></var> on all <a href="#track-buffer">track buffers</a> to true.</li>
                     <li>Unset <var><a href="#sourcebuffer-sequence-start-timestamp">sequence start timestamp</a></var>.</li>
                   </ol>
                 </li>
@@ -1762,9 +1770,9 @@
                 <li>Let <var>track buffer</var> equal the <a href="#track-buffer">track buffer</a> that the coded frame will be added to.</li>
                 <li>
                   <dl class="switch">
-                    <dt>If <var>discontinuity flag</var> equals true:</dt>
                     <dt>If <var><a href="#last-decode-timestamp">last decode timestamp</a></var> for <var>track buffer</var> is set and <var>decode timestamp</var> is less than
                       <var><a href="#last-decode-timestamp">last decode timestamp</a></var>:</dt>
+                    <dd>OR</dd>
                     <dt>If <var><a href="#last-decode-timestamp">last decode timestamp</a></var> for <var>track buffer</var> is set and the difference between <var>decode timestamp</var> and <var><a href="#last-decode-timestamp">last decode timestamp</a></var>
                       is greater than 2 times <var><a href="#last-frame-duration">last frame duration</a></var>:</dt>
                     <dd>
@@ -2149,6 +2157,7 @@
 <span class="idlAttribute">    readonly    attribute <span class="idlAttrType"><code><a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-unsigned-long" class="idlType">unsigned long</a></code></span>       <span class="idlAttrName"><a href="#widl-VideoPlaybackQuality-totalVideoFrames">totalVideoFrames</a></span>;</span>
 <span class="idlAttribute">    readonly    attribute <span class="idlAttrType"><code><a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-unsigned-long" class="idlType">unsigned long</a></code></span>       <span class="idlAttrName"><a href="#widl-VideoPlaybackQuality-droppedVideoFrames">droppedVideoFrames</a></span>;</span>
 <span class="idlAttribute">    readonly    attribute <span class="idlAttrType"><code><a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-unsigned-long" class="idlType">unsigned long</a></code></span>       <span class="idlAttrName"><a href="#widl-VideoPlaybackQuality-corruptedVideoFrames">corruptedVideoFrames</a></span>;</span>
+<span class="idlAttribute">    readonly    attribute <span class="idlAttrType"><code><a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-double" class="idlType">double</a></code></span>              <span class="idlAttrName"><a href="#widl-VideoPlaybackQuality-playbackJitter">playbackJitter;</a></span>;</span>
 };</span></pre><section id="attributes-3"><h3><span class="secno">5.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-VideoPlaybackQuality-corruptedVideoFrames"><code>corruptedVideoFrames</code> of type <span class="idlAttrType"><code><a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-unsigned-long" class="idlType">unsigned long</a></code></span>, readonly   </dt><dd>
           <p>The total number of corrupted frames that have been detected.</p>
         </dd><dt id="widl-VideoPlaybackQuality-creationTime"><code>creationTime</code> of type <span class="idlAttrType"><code><a href="http://www.w3.org/TR/hr-time/#sec-DOMHighResTimeStamp" class="idlType">DOMHighResTimeStamp</a></code></span>, readonly   </dt><dd>
@@ -2156,6 +2165,8 @@
         </dd><dt id="widl-VideoPlaybackQuality-droppedVideoFrames"><code>droppedVideoFrames</code> of type <span class="idlAttrType"><code><a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-unsigned-long" class="idlType">unsigned long</a></code></span>, readonly   </dt><dd>
           <p>The total number of frames dropped predecode or dropped because the frame missed
             its display deadline.</p>
+        </dd><dt id="widl-VideoPlaybackQuality-playbackJitter"><code>playbackJitter;</code> of type <span class="idlAttrType"><code><a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-double" class="idlType">double</a></code></span>, readonly   </dt><dd>
+          <p>The sum of all <a href="#display-duration-error">display duration errors</a> for all frames included in the <code><a href="#widl-VideoPlaybackQuality-totalVideoFrames">totalVideoFrames</a></code> count.</p>
         </dd><dt id="widl-VideoPlaybackQuality-totalVideoFrames"><code>totalVideoFrames</code> of type <span class="idlAttrType"><code><a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-unsigned-long" class="idlType">unsigned long</a></code></span>, readonly   </dt><dd>
           <p>The total number of frames that would have been displayed if no frames are dropped.</p>
         </dd></dl></section>
@@ -2234,6 +2245,12 @@
         and <var><a href="#dropped-video-frame-count">dropped video frame count</a></var> must be updated appropriately.
       </p>
 
+      <p>Each <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#htmlvideoelement">HTMLVideoElement</a></code> will maintain a <dfn id="display-duration-error-sum">display duration error sum</dfn> variable that keeps
+        track of the sum of all <a href="#display-duration-error">display duration errors</a>. This variable is initialized to 0 when the element is created and whenever the
+        <a href="http://www.w3.org/TR/html5/embedded-content-0.html#media-element-load-algorithm">media element load algorithm</a> is invoked. When a frame causes the <var><a href="#total-video-frame-count">total video frame count</a></var> to increment, the
+        <a href="#display-duration-error">display duration error</a> for that frame is computed and added to this variable.
+      </p>
+
       <pre class="idl"><span class="idlInterface" id="idl-def-HTMLVideoElement">partial interface <span class="idlInterfaceID">HTMLVideoElement</span> {
 <span class="idlAttribute">    readonly    attribute <span class="idlAttrType"><a href="#idl-def-VideoPlaybackQuality" class="idlType"><code>VideoPlaybackQuality</code></a></span> <span class="idlAttrName"><a href="#widl-HTMLVideoElement-videoPlaybackQuality">videoPlaybackQuality</a></span>;</span>
 };</span></pre><section id="attributes-4"><h3><span class="secno">8.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-HTMLVideoElement-videoPlaybackQuality"><code>videoPlaybackQuality</code> of type <span class="idlAttrType"><a href="#idl-def-VideoPlaybackQuality" class="idlType"><code>VideoPlaybackQuality</code></a></span>, readonly   </dt><dd>
@@ -2245,6 +2262,7 @@
             <li>Set <var>playbackQuality</var>.<code><a href="#widl-VideoPlaybackQuality-totalVideoFrames">totalVideoFrames</a></code> to the current value of the <var><a href="#total-video-frame-count">total video frame count</a></var>.</li>
             <li>Set <var>playbackQuality</var>.<code><a href="#widl-VideoPlaybackQuality-droppedVideoFrames">droppedVideoFrames</a></code> to the current value of the <var><a href="#dropped-video-frame-count">dropped video frame count</a></var>.</li>
             <li>Set <var>playbackQuality</var>.<code><a href="#widl-VideoPlaybackQuality-corruptedVideoFrames">corruptedVideoFrames</a></code> to the current value of the <var><a href="#corrupted-video-frame-count">corrupted video frame count</a></var>.</li>
+            <li>Set <var>playbackQuality</var>.<code><a href="#widl-VideoPlaybackQuality-playbackJitter">playbackJitter</a></code> to the current value of the <var><a href="#display-duration-error-sum">display duration error sum</a></var>.</li>
             <li>Return <var>playbackQuality</var>.</li>
           </ol>
         </dd></dl></section>
@@ -2387,6 +2405,9 @@
     <section id="byte-stream-formats">
       <!--OddPage--><h2><span class="secno">12. </span>Byte Stream Formats</h2>
       <p>The bytes provided through <code><a href="#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data">appendBuffer()</a></code> and <code><a href="#widl-SourceBuffer-appendStream-void-Stream-stream-unsigned-long-long-maxSize">appendStream()</a></code> for a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a> form a logical byte stream. The format of this byte stream depends on the media container format in use and is defined in a byte stream format specification. Byte stream format specifications based on WebM , the ISO Base Media File Format, and MPEG-2 Transport Streams are provided below. These format specifications are intended to be the authoritative source for how data from these containers is formatted and passed to a <a href="#idl-def-SourceBuffer" class="idlType"><code>SourceBuffer</code></a>. If a <a href="#idl-def-MediaSource" class="idlType"><code>MediaSource</code></a> implementation claims to support any of these container formats, then it must implement the corresponding byte stream format specification described below.</p>
+      <div class="note"><div class="note-title"><span>Note</span></div><p class="">The byte stream format specifications below are not intended to define new storage formats. They simply outline the subset of
+        existing storage format structures that implementations of this specification will accept.</p></div>
+
       <p>This section provides general requirements for all byte stream formats:</p>
       <ul>
         <li>A byte stream format specification must define <a href="#init-segment">initialization segments</a> and <a href="#media-segment">media segments</a>.</li>
@@ -2696,7 +2717,20 @@
         </thead>
         <tbody>
           <tr>
-            <td>01 June 2013</td>
+            <td>05 June 2013</td>
+            <td>
+              <ul>
+                <li>Bug 22139 - Added a note clarifying that byte stream specs aren't defining new storage formats.</li>
+                <li>Bug 22148 - Added playbackJitter metric.</li>
+                <li>Bug 22134 - Added minimal number of SourceBuffers requirements.</li>
+                <li>Bug 22115 - Make algorithm abort text consistent.</li>
+                <li>Bug 22113 - Address typos.</li>
+                <li>Bug 22065 - Fix infinite loop in coded frame processing algorithm.</li>
+              </ul>
+            </td>
+          </tr>
+          <tr>
+            <td><a href="https://dvcs.w3.org/hg/html-media/raw-file/1ac9c2205a7b/media-source/media-source.html">01 June 2013</a></td>
             <td>
               <ul>
                 <li>Bug 21431 - Updated coded frame processing algorithm for text splicing.</li>
--- a/media-source/media-source.js	Tue Jun 04 08:01:41 2013 -0700
+++ b/media-source/media-source.js	Wed Jun 05 07:34:10 2013 -0700
@@ -159,6 +159,7 @@
     'totalVideoFrames': { func: idlref_helper, fragment: 'widl-VideoPlaybackQuality-totalVideoFrames', link_text: 'totalVideoFrames',  },
     'droppedVideoFrames': { func: idlref_helper, fragment: 'widl-VideoPlaybackQuality-droppedVideoFrames', link_text: 'droppedVideoFrames',  },
     'corruptedVideoFrames': { func: idlref_helper, fragment: 'widl-VideoPlaybackQuality-corruptedVideoFrames', link_text: 'corruptedVideoFrames',  },
+    'playbackJitter': { func: idlref_helper, fragment: 'widl-VideoPlaybackQuality-playbackJitter', link_text: 'playbackJitter',  },
     'createObjectURL': { func: idlref_helper, fragment: 'widl-URL-createObjectURL-DOMString-MediaSource-mediaSource', link_text: 'createObjectURL()',  },
     'open': { func: idlref_helper, fragment: 'idl-def-ReadyState.open', link_text: '"open"',  },
     'closed': { func: idlref_helper, fragment: 'idl-def-ReadyState.closed', link_text: '"closed"',  },
@@ -192,6 +193,8 @@
     'coded-frames': { func: term_helper, fragment: 'coded-frame', link_text: 'coded frames', },
     'parent-media-source': { func: term_helper, fragment: 'parent-media-source', link_text: 'parent media source', },
     'coded-frame-sequence': { func: term_helper, fragment: 'coded-frame-sequence', link_text: 'coded frame sequence', },
+    'display-duration-error': { func: term_helper, fragment: 'display-duration-error', link_text: 'display duration error', },
+    'display-duration-errors': { func: term_helper, fragment: 'display-duration-error', link_text: 'display duration errors', },
     'append-window': { func: term_helper, fragment: 'append-window', link_text: 'append window', },
     'enough-data': { func: term_helper, fragment: 'enough-data', link_text: 'enough data to ensure uninterrupted playback', },
     'active-track-buffers': { func: term_helper, fragment: 'active-track-buffers', link_text: 'active track buffers', },
@@ -298,6 +301,7 @@
     'total-video-frame-count': { func: var_helper, fragment: '#total-video-frame-count', link_text: 'total video frame count', },
     'dropped-video-frame-count': { func: var_helper, fragment: '#dropped-video-frame-count', link_text: 'dropped video frame count', },
     'corrupted-video-frame-count': { func: var_helper, fragment: '#corrupted-video-frame-count', link_text: 'corrupted video frame count', },
+    'display-duration-error-sum': { func: var_helper, fragment: '#display-duration-error-sum', link_text: 'display duration error sum', },
 
     'invalid-access-err': { func: exception_helper, fragment: 'invalid_access_err', link_text: 'INVALID_ACCESS_ERR',  },
     'invalid-state-err': { func: exception_helper, fragment: 'invalid_state_err', link_text: 'INVALID_STATE_ERR',  },