Addressed several endOfStream() bugs.
authorAaron Colwell <acolwell@google.com>
Thu, 13 Sep 2012 17:53:17 -0700
changeset 33349559debcc3
parent 32 cab1d5203944
child 34 390143e813b7
Addressed several endOfStream() bugs.

- Added a step to endOfStream() to queue & fire the sourceended event.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18624
- Updated endOfStream("network") to change behavior based on HTMLMediaElement.readyState.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18622
- Updated endOfStream("decode") to change behavior based on HTMLMediaElement.readyState.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18660
- Updated append() MEDIA_ERR_DECODE text to call endOfStream("decode").
media-source/media-source.html
media-source/media-source.xml
media-source/spec-html.xsl
     1.1 --- a/media-source/media-source.html	Sat Sep 01 16:03:07 2012 -0700
     1.2 +++ b/media-source/media-source.html	Thu Sep 13 17:53:17 2012 -0700
     1.3 @@ -42,7 +42,7 @@
     1.4      <div class="head">
     1.5        <p><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" alt="W3C" width="72" height="48"></a></p>
     1.6        <h1>Media Source Extensions</h1>
     1.7 -      <h2>W3C Editor's Draft 24 August 2012</h2>
     1.8 +      <h2>W3C Editor's Draft 13 September 2012</h2>
     1.9        <dl>
    1.10  	<dt>Latest published version:</dt>
    1.11  	<dd>Not yet published</dd>
    1.12 @@ -411,17 +411,21 @@
    1.13      <h5>End of stream error values:</h5>
    1.14      <dl>
    1.15        <dt><dfn id='dom-"network"'><code>"network"</code></dfn></dt>
    1.16 -      <dd>The stream ended prematurely because of a network error. If the JavaScript code fetching media data encounters a network error it should use this status code to terminate playback. This will cause the media element's error handling code to run and the <code>error</code> attribute to be set to <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-mediaerror-media_err_network">MediaError.MEDIA_ERR_NETWORK</a></code>
    1.17 -</dd>
    1.18 +      <dd>Terminates playback and signals that a network error has occured.</dd> 
    1.19 +      <p class="note">Note: If the JavaScript fetching media data encounters a network error it should use this status code to terminate playback.</p>
    1.20  
    1.21        <dt><dfn id='dom-"decode"'><code>"decode"</code></dfn></dt>
    1.22 -      <dd>The stream ended prematurely because there was an error while decoding the media data. If the JavaScript code fetching media data has problems parsing the data it should use this status code to terminate playback. This will cause the media element's error handling code to run and the <code>error</code> attribute to be set to <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-mediaerror-media_err_decode">MediaError.MEDIA_ERR_DECODE</a></code>.</dd>
    1.23 +      <dd>Terminates playback and signals that a decoding error has occured.</dd>
    1.24 +      <p class="note">Note: If the JavaScript code fetching media data has problems parsing the data it should use this status code to terminate playback.</p>
    1.25      </dl>
    1.26  
    1.27      <p>The <dfn id="dom-endofstream"><code>endOfStream(error)</code></dfn> method must run the following steps:</p>
    1.28      <ol>
    1.29        <li>If the <code><a href="#dom-readystate">readyState</a></code> attribute is not in the <code><a href="#dom-%22open%22">"open"</a></code> state then throw an <code><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
    1.30        <li>Change the <code><a href="#dom-readystate">readyState</a></code> attribute value to <code><a href="#dom-%22ended%22">"ended"</a></code>.</li>
    1.31 +      <li>
    1.32 +<a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named
    1.33 +   <code><a href="#dom-sourceended">sourceended</a></code> at the <code><a href="#dom-mediasource">MediaSource</a></code>.</li>
    1.34        <dl class="switch">
    1.35            <dt>If <var title="true">error</var> is not set, null, or an empty string</dt>
    1.36            <dd>
    1.37 @@ -434,10 +438,28 @@
    1.38  	  </dd>
    1.39            <dt>If <var title="true">error</var> is set to <code><a href="#dom-%22network%22">"network"</a></code>
    1.40  </dt>
    1.41 -          <dd>Run the "If the connection is interrupted, causing the user agent to give up trying to fetch the resource" section of the <a href="http://dev.w3.org/html5/spec/media-elements.html#concept-media-load-resource">resource fetch algorithm</a>.</dd>
    1.42 +          <dd>
    1.43 +	    <dl class="switch">
    1.44 +	      <dt>If <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> attribute equals <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-media-have_nothing">HAVE_NOTHING</a></code>
    1.45 +</dt>
    1.46 +	      <dd>Run the "<i>If the media data cannot be fetched at all, due to network errors, causing the user agent to give up trying to fetch the resource</i>" steps of the <a href="http://dev.w3.org/html5/spec/media-elements.html#concept-media-load-resource">resource fetch algorithm</a>.</dd>
    1.47 +	      <dt>If <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> attribute greater than <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-media-have_nothing">HAVE_NOTHING</a></code>
    1.48 +</dt>
    1.49 +	      <dd>Run the "<i>If the connection is interrupted after some media data has been received, causing the user agent to give up trying to fetch the resource</i>" steps of the <a href="http://dev.w3.org/html5/spec/media-elements.html#concept-media-load-resource">resource fetch algorithm</a>.</dd>
    1.50 +	    </dl>
    1.51 +	  </dd>
    1.52            <dt>If <var title="true">error</var> is set to <code><a href="#dom-%22decode%22">"decode"</a></code>
    1.53  </dt>
    1.54 -          <dd>Run the "If the media data is corrupted" section of the <a href="http://dev.w3.org/html5/spec/media-elements.html#concept-media-load-resource">resource fetch algorithm</a>.</dd>
    1.55 +          <dd>
    1.56 +	    <dl class="switch">
    1.57 +	      <dt>If <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> attribute equals <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-media-have_nothing">HAVE_NOTHING</a></code>
    1.58 +</dt>
    1.59 +	      <dd>Run the "<i>If the media data can be fetched but is found by inspection to be in an unsupported format, or can otherwise not be rendered at all</i>" steps of the <a href="http://dev.w3.org/html5/spec/media-elements.html#concept-media-load-resource">resource fetch algorithm</a>.</dd>
    1.60 +	      <dt>If <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-media-readystate">HTMLMediaElement.readyState</a></code> attribute greater than <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-media-have_nothing">HAVE_NOTHING</a></code>
    1.61 +</dt>
    1.62 +	      <dd>Run the <a href="http://dev.w3.org/html5/spec/media-elements.html#fatal-decode-error">media data is corrupted</a> steps of the <a href="http://dev.w3.org/html5/spec/media-elements.html#concept-media-load-resource">resource fetch algorithm</a>.</dd>
    1.63 +	    </dl>
    1.64 +	  </dd>
    1.65            <dt>Otherwise</dt>
    1.66            <dd>Throw an <code><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-invalid_access_err">INVALID_ACCESS_ERR</a></code> exception.</dd>
    1.67          </dl>
    1.68 @@ -499,7 +521,9 @@
    1.69        <li>Set the <code><a href="#dom-readystate">readyState</a></code> attribute to <code><a href="#dom-closed">"closed"</a></code>.</li>
    1.70        <li>Set the <code><a href="#dom-duration">duration</a></code> attribute to NaN.</li>
    1.71        <li>Remove all the <code><a href="#dom-sourcebuffer">SourceBuffer</a></code> objects from <code><a href="#dom-sourcebuffers">sourceBuffers</a></code> and fire a <code><a href="#dom-removesourcebuffer">removesourcebuffer</a></code> event for each one.</li>
    1.72 -      <li>Fire a simple event named <code><a href="#dom-sourceclose">sourceclose</a></code>.</li>
    1.73 +      <li>
    1.74 +<a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a task</a> to <a href="http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fire a simple event</a> named
    1.75 +   <code><a href="#dom-sourceclose">sourceclose</a></code> at the <code><a href="#dom-mediasource">MediaSource</a></code>.</li>
    1.76      </ol>
    1.77  
    1.78      <h4 id="mediasource-seeking">3.3.3 Seeking</h4>
    1.79 @@ -576,7 +600,7 @@
    1.80        </dd>
    1.81      </dl>
    1.82  
    1.83 -    <h4 id="active-source-buffer-changes">3.3.5 Changes to selected/enabled track state.</h4>
    1.84 +    <h4 id="active-source-buffer-changes">3.3.5 Changes to selected/enabled track state</h4>
    1.85      <p>During playback <code><a href="#dom-activesourcebuffers">activeSourceBuffers</a></code> needs to be updated if the <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-videotrack-selected">selected video track</a></code>, the <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-audiotrack-enabled">enabled audio tracks</a></code>, or a text track <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-texttrack-mode">mode</a></code> changes. When one or more of these changes occur the following steps need to be followed.</p>
    1.86      <dl class="switch">
    1.87        <dt>If the selected video track changes</dt>
    1.88 @@ -603,7 +627,7 @@
    1.89  </dd>
    1.90      </dl>
    1.91  
    1.92 -    <h4 id="duration-change-algorithm">3.3.6 Duration change.</h4>
    1.93 +    <h4 id="duration-change-algorithm">3.3.6 Duration change</h4>
    1.94      <p>Follow these steps when <code><a href="#dom-duration">duration</a></code> needs to change to a <var title="true">new duration</var>.</p>
    1.95      <ol>
    1.96        <li>If the current value of <code><a href="#dom-duration">duration</a></code> is equal to <var title="true">new duration</var>, then abort these steps.</li>
    1.97 @@ -648,14 +672,14 @@
    1.98        <li>If this object has been removed from the <code><a href="#dom-sourcebuffers">sourceBuffers</a></code> attribute of the <code><a href="#dom-mediasource">MediaSource</a></code> object that created it then throw an <code><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
    1.99        <li>If the <code><a href="#dom-readystate">readyState</a></code> attribute of the <code><a href="#dom-mediasource">MediaSource</a></code> object that created this object is not in the <code><a href="#dom-%22open%22">"open"</a></code> state then throw an <code><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</li>
   1.100        <li>If <var title="true">data</var>.byteLength is 0 abort these steps.</li>
   1.101 -      <li>If <var title="true">data</var> contains anything that violates the <a href="#byte-stream-formats">byte stream format specifications</a>, then run the media element's error handling code to signal a <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-mediaerror-media_err_decode">MediaError.MEDIA_ERR_DECODE</a></code> error, and abort these steps.</li>
   1.102 +      <li>If <var title="true">data</var> contains anything that violates the <a href="#byte-stream-formats">byte stream format specifications</a>, then call <code><a href="#dom-endofstream">endOfStream("decode")</a></code>, and abort these steps.</li>
   1.103        <li>Add <var title="true">data</var> to the source buffer:
   1.104  	<dl class="switch">
   1.105  	  <dt>If <var title="true">data</var> is part of a <a href="#media-segment">media segment</a> and <code><a href="#dom-timestampoffset">timestampOffset</a></code> is not 0:</dt>
   1.106  	  <dd>
   1.107  	    <ol>
   1.108  	      <li>Find all timestamps inside <var title="true">data</var> and add <code><a href="#dom-timestampoffset">timestampOffset</a></code> to them.</li>
   1.109 -	      <li>If any of the modified timestamps are earlier than the <a href="#presentation-start-time">presentation start time</a>, run the media element's error handling code to signal a <code><a href="http://dev.w3.org/html5/spec/media-elements.html#dom-mediaerror-media_err_decode">MediaError.MEDIA_ERR_DECODE</a></code> error, and abort these steps.</li>
   1.110 +	      <li>If any of the modified timestamps are earlier than the <a href="#presentation-start-time">presentation start time</a>, then call <code><a href="#dom-endofstream">endOfStream("decode")</a></code>, and abort these steps.</li>
   1.111  	      <li>Copy the contents of <var title="true">data</var>, with the modified timestamps, into the source buffer.</li>
   1.112  	    </ol>
   1.113  	  </dd>
   1.114 @@ -984,7 +1008,11 @@
   1.115        </thead>
   1.116        <tbody>
   1.117          <tr>
   1.118 -	  <td>24 August 2012</td>
   1.119 +	  <td>13 September 2012</td>
   1.120 +          <td>Added decode error &amp; network error algorithms.</td>
   1.121 +        </tr>
   1.122 +        <tr>
   1.123 +	  <td><a href="http://dvcs.w3.org/hg/html-media/raw-file/ca093bbbbefb/media-source/media-source.html">24 August 2012</a></td>
   1.124            <td>
   1.125  	    <ul>
   1.126  	      <li>Added early abort on to duration change algorithm.</li>
     2.1 --- a/media-source/media-source.xml	Sat Sep 01 16:03:07 2012 -0700
     2.2 +++ b/media-source/media-source.xml	Thu Sep 13 17:53:17 2012 -0700
     2.3 @@ -41,7 +41,7 @@
     2.4      <div class="head">
     2.5        <p><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" alt="W3C" width="72" height="48" /></a></p>
     2.6        <h1>Media Source Extensions</h1>
     2.7 -      <h2>W3C Editor's Draft 24 August 2012</h2>
     2.8 +      <h2>W3C Editor's Draft 13 September 2012</h2>
     2.9        <dl>
    2.10  	<dt>Latest published version:</dt>
    2.11  	<dd>Not yet published</dd>
    2.12 @@ -398,16 +398,19 @@
    2.13      <h5>End of stream error values:</h5>
    2.14      <dl>
    2.15        <dt><codedfn>&quot;network&quot;</codedfn></dt>
    2.16 -      <dd>The stream ended prematurely because of a network error. If the JavaScript code fetching media data encounters a network error it should use this status code to terminate playback. This will cause the media element's error handling code to run and the <code>error</code> attribute to be set to <videoref name="dom-mediaerror-media_err_network">MediaError.MEDIA_ERR_NETWORK</videoref></dd>
    2.17 +      <dd>Terminates playback and signals that a network error has occured.</dd> 
    2.18 +      <p class="note">Note: If the JavaScript fetching media data encounters a network error it should use this status code to terminate playback.</p>
    2.19  
    2.20        <dt><codedfn>&quot;decode&quot;</codedfn></dt>
    2.21 -      <dd>The stream ended prematurely because there was an error while decoding the media data. If the JavaScript code fetching media data has problems parsing the data it should use this status code to terminate playback. This will cause the media element's error handling code to run and the <code>error</code> attribute to be set to <media-err-decode/>.</dd>
    2.22 +      <dd>Terminates playback and signals that a decoding error has occured.</dd>
    2.23 +      <p class="note">Note: If the JavaScript code fetching media data has problems parsing the data it should use this status code to terminate playback.</p>
    2.24      </dl>
    2.25  
    2.26      <p>The <methoddfn name="endOfStream">endOfStream(<var title="true">error</var>)</methoddfn> method must run the following steps:</p>
    2.27      <ol>
    2.28        <li>If the <readyState/> attribute is not in the <open/> state then throw an <invalid-state-err/> exception and abort these steps.</li>
    2.29        <li>Change the <readyState/> attribute value to <ended/>.</li>
    2.30 +      <li><queue-a-task-to-fire-an-event-named/> <coderef>sourceended</coderef> at the <MediaSource/>.</li>
    2.31        <dl class="switch">
    2.32            <dt>If <var title="true">error</var> is not set, null, or an empty string</dt>
    2.33            <dd>
    2.34 @@ -419,9 +422,23 @@
    2.35  	    </ol>
    2.36  	  </dd>
    2.37            <dt>If <var title="true">error</var> is set to <coderef>&quot;network&quot;</coderef></dt>
    2.38 -          <dd>Run the "If the connection is interrupted, causing the user agent to give up trying to fetch the resource" section of the <resource-fetch-algorithm/>.</dd>
    2.39 +          <dd>
    2.40 +	    <dl class="switch">
    2.41 +	      <dt>If <ready-state/> attribute equals <have-nothing/></dt>
    2.42 +	      <dd>Run the &quot;<i>If the media data cannot be fetched at all, due to network errors, causing the user agent to give up trying to fetch the resource</i>&quot; steps of the <resource-fetch-algorithm/>.</dd>
    2.43 +	      <dt>If <ready-state/> attribute greater than <have-nothing/></dt>
    2.44 +	      <dd>Run the &quot;<i>If the connection is interrupted after some media data has been received, causing the user agent to give up trying to fetch the resource</i>&quot; steps of the <resource-fetch-algorithm/>.</dd>
    2.45 +	    </dl>
    2.46 +	  </dd>
    2.47            <dt>If <var title="true">error</var> is set to <coderef>&quot;decode&quot;</coderef></dt>
    2.48 -          <dd>Run the "If the media data is corrupted" section of the <resource-fetch-algorithm/>.</dd>
    2.49 +          <dd>
    2.50 +	    <dl class="switch">
    2.51 +	      <dt>If <ready-state/> attribute equals <have-nothing/></dt>
    2.52 +	      <dd>Run the &quot;<i>If the media data can be fetched but is found by inspection to be in an unsupported format, or can otherwise not be rendered at all</i>&quot; steps of the <resource-fetch-algorithm/>.</dd>
    2.53 +	      <dt>If <ready-state/> attribute greater than <have-nothing/></dt>
    2.54 +	      <dd>Run the <media-data-is-corrupted/> steps of the <resource-fetch-algorithm/>.</dd>
    2.55 +	    </dl>
    2.56 +	  </dd>
    2.57            <dt>Otherwise</dt>
    2.58            <dd>Throw an <invalid-access-err/> exception.</dd>
    2.59          </dl>
    2.60 @@ -482,7 +499,7 @@
    2.61        <li>Set the <readyState/> attribute to <closed/>.</li>
    2.62        <li>Set the <duration/> attribute to NaN.</li>
    2.63        <li>Remove all the <SourceBuffer/> objects from <sourceBuffers/> and fire a <coderef>removesourcebuffer</coderef> event for each one.</li>
    2.64 -      <li>Fire a simple event named <coderef>sourceclose</coderef>.</li>
    2.65 +      <li><queue-a-task-to-fire-an-event-named/> <coderef>sourceclose</coderef> at the <MediaSource/>.</li>
    2.66      </ol>
    2.67  
    2.68      <h4 id="mediasource-seeking">3.3.3 Seeking</h4>
    2.69 @@ -556,7 +573,7 @@
    2.70        </dd>
    2.71      </dl>
    2.72  
    2.73 -    <h4 id="active-source-buffer-changes">3.3.5 Changes to selected/enabled track state.</h4>
    2.74 +    <h4 id="active-source-buffer-changes">3.3.5 Changes to selected/enabled track state</h4>
    2.75      <p>During playback <activeSourceBuffers/> needs to be updated if the <videoref name="dom-videotrack-selected">selected video track</videoref>, the <videoref name="dom-audiotrack-enabled">enabled audio tracks</videoref>, or a text track <videoref name="dom-texttrack-mode">mode</videoref> changes. When one or more of these changes occur the following steps need to be followed.</p>
    2.76      <dl class="switch">
    2.77        <dt>If the selected video track changes</dt>
    2.78 @@ -576,7 +593,7 @@
    2.79        <dd>Add the <SourceBuffer/> associated with the text track to <activeSourceBuffers/></dd>
    2.80      </dl>
    2.81  
    2.82 -    <h4 id="duration-change-algorithm">3.3.6 Duration change.</h4>
    2.83 +    <h4 id="duration-change-algorithm">3.3.6 Duration change</h4>
    2.84      <p>Follow these steps when <duration/> needs to change to a <new-duration/>.</p>
    2.85      <ol>
    2.86        <li>If the current value of <duration/> is equal to <new-duration/>, then abort these steps.</li>
    2.87 @@ -621,14 +638,14 @@
    2.88        <li>If this object has been removed from the <sourceBuffers/> attribute of the <MediaSource/> object that created it then throw an <invalid-state-err/> exception and abort these steps.</li>
    2.89        <li>If the <readyState/> attribute of the <MediaSource/> object that created this object is not in the <open/> state then throw an <invalid-state-err/> exception and abort these steps.</li>
    2.90        <li>If <var title="true">data</var>.byteLength is 0 abort these steps.</li>
    2.91 -      <li>If <var title="true">data</var> contains anything that violates the <a href="#byte-stream-formats">byte stream format specifications</a>, then run the media element's error handling code to signal a <media-err-decode/> error, and abort these steps.</li>
    2.92 +      <li>If <var title="true">data</var> contains anything that violates the <a href="#byte-stream-formats">byte stream format specifications</a>, then call <eos-decode/>, and abort these steps.</li>
    2.93        <li>Add <var title="true">data</var> to the source buffer:
    2.94  	<dl class="switch">
    2.95  	  <dt>If <var title="true">data</var> is part of a <media-segment/> and <timestampOffset/> is not 0:</dt>
    2.96  	  <dd>
    2.97  	    <ol>
    2.98  	      <li>Find all timestamps inside <var title="true">data</var> and add <timestampOffset/> to them.</li>
    2.99 -	      <li>If any of the modified timestamps are earlier than the <presentation-start-time/>, run the media element's error handling code to signal a <media-err-decode/> error, and abort these steps.</li>
   2.100 +	      <li>If any of the modified timestamps are earlier than the <presentation-start-time/>, then call <eos-decode/>, and abort these steps.</li>
   2.101  	      <li>Copy the contents of <var title="true">data</var>, with the modified timestamps, into the source buffer.</li>
   2.102  	    </ol>
   2.103  	  </dd>
   2.104 @@ -950,7 +967,11 @@
   2.105        </thead>
   2.106        <tbody>
   2.107          <tr>
   2.108 -	  <td>24 August 2012</td>
   2.109 +	  <td>13 September 2012</td>
   2.110 +          <td>Updated endOfStream() behavior to change based on the value of HTMLMediaElement.readyState.</td>
   2.111 +        </tr>
   2.112 +        <tr>
   2.113 +	  <td><a href="http://dvcs.w3.org/hg/html-media/raw-file/ca093bbbbefb/media-source/media-source.html">24 August 2012</a></td>
   2.114            <td>
   2.115  	    <ul>
   2.116  	      <li>Added early abort on to duration change algorithm.</li>
     3.1 --- a/media-source/spec-html.xsl	Sat Sep 01 16:03:07 2012 -0700
     3.2 +++ b/media-source/spec-html.xsl	Thu Sep 13 17:53:17 2012 -0700
     3.3 @@ -106,7 +106,14 @@
     3.4    <xsl:template match="//new-duration">
     3.5      <var title="true">new duration</var>
     3.6    </xsl:template>
     3.7 -  
     3.8 +
     3.9 +  <xsl:template match="//eos-decode">
    3.10 +    <xsl:call-template name="coderef_helper">
    3.11 +      <xsl:with-param name="fragment">endofstream</xsl:with-param>
    3.12 +      <xsl:with-param name="link_text">endOfStream(&quot;decode&quot;)</xsl:with-param>
    3.13 +    </xsl:call-template>
    3.14 +  </xsl:template>
    3.15 +
    3.16    <!-- SourceBufferList tags -->
    3.17    <xsl:template match="//length">
    3.18      <xsl:call-template name="coderef_helper">
    3.19 @@ -323,6 +330,13 @@
    3.20      </xsl:call-template>
    3.21    </xsl:template>
    3.22  
    3.23 +  <xsl:template match="//media-data-is-corrupted">
    3.24 +    <xsl:call-template name="videoref_helper">
    3.25 +      <xsl:with-param name="fragment">fatal-decode-error</xsl:with-param>
    3.26 +      <xsl:with-param name="link_text">media data is corrupted</xsl:with-param>
    3.27 +    </xsl:call-template>
    3.28 +  </xsl:template>
    3.29 +
    3.30    <xsl:template match="//media-err-decode">
    3.31      <xsl:call-template name="code_videoref_helper">
    3.32        <xsl:with-param name="fragment">dom-mediaerror-media_err_decode</xsl:with-param>