Bug 23553 - Segment parser loop appears to discard Media Segment header
Summary: Segment parser loop appears to discard Media Segment header
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC All
: P2 minor
Target Milestone: LC
Assignee: Aaron Colwell
QA Contact: HTML WG Bugzilla archive list
Depends on:
Reported: 2013-10-17 19:55 UTC by Mark Watson
Modified: 2013-10-29 22:11 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Mark Watson 2013-10-17 19:55:53 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.
Comment 1 Aaron Colwell 2013-10-18 20:40:03 UTC
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.
Comment 2 Aaron Colwell 2013-10-29 22:11:34 UTC
Change committed

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.