[media-source] Potential interop issue in coded frame processing

wolenetz has just created a new issue for https://github.com/w3c/media-source:

== Potential interop issue in coded frame processing ==
Imagine a very strange media segment containing a sequence of frames as follows
<dts,pts,duration> (both are keyframes, previously the duration was 0):

<0, 1000, 10>
<30, 10, 10>

*If* the coded frame processing algorithm is run with these two frames while in 'segments' AppendMode, then the last step of the algorithm:

> If the media segment contains data beyond the current duration, then run the duration change algorithm with new duration set to the maximum of the current duration and the group end timestamp.

would set the duration to 20, not 1010. This is because the group end timestamp is reset to 10 following the dts discontinuity, and then increased to 20 based on the duration of that frame following the discontinuity.

While contrived a bit, this highlights an opportunity to clarify that line of the spec to more precisely indicate the normative behavior that is intended.

For example, something like either:
A) 
"Let _highest end time_ be the largest track buffer ranges end time across all the track buffers for this SourceBuffer. If _highest end time_ is larger than the current duration, then run the duration change algorithm with new duration set to _highest end time_"

or

B) accomplish the same as A by remembering the highest frame end timestamp encountered in this coded frame processing algorithm's execution and if that is larger than current duration, then run the duration change algorithm with that highest frame end timestamp.

Both of these options align with the logic in the duration change algorithm that prevents reducing duration below the highest end time of any buffered frame across all track buffers across all SourceBuffers in the MediaSource.

Please view or discuss this issue at https://github.com/w3c/media-source/issues/203 using your GitHub account

Received on Thursday, 2 November 2017 23:30:46 UTC