Bugzilla – Bug 23553
Segment parser loop appears to discard Media Segment header
Last modified: 2013-10-29 22:11:34 UTC
Section 3.5.1, step 6, if the input buffer does contain a complete media segment (sub-step 2) but it does not contain a complete coded frame, then the coded frame processing algorithm is not run and at sub-step 4 the media segment bytes (containing the header) are removed.
A possible fix would be to jump after sub-step 3 to the 'Need more data' step if the entire media segment is not in the input buffer. The media segment data is then not discarded (and step 6 is not executed) until the entire segment is received.
This also obviates the need for the NOTE about incremental parsers.
I'll figure out a way to reword this. I just want to make it clear that coded frame processing may begin before the end of the segment is actually received. I also think that it is important to make it clear that once a coded frame is processed, the data is not necessarily still available in the input buffer. That is why the current algorithm removes media segment data as it goes.
I basically went w/ Mark's suggestions, but put the new step after sub-step 4 instead of sub-step 3 so that the SourceBuffer can signal that it can't accept more data.