This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28557 - Coded frame removal algorithm may introduce discontinuity at end of current coded frame group
Summary: Coded frame removal algorithm may introduce discontinuity at end of current c...
Status: RESOLVED MOVED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Matt Wolenetz
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-24 19:47 UTC by Matt Wolenetz
Modified: 2015-10-13 23:07 UTC (History)
3 users (show)

See Also:


Attachments

Description Matt Wolenetz 2015-04-24 19:47:47 UTC
If a remove() operation or range removal algorithm execution due to coded frame eviction algorithm removes buffer(s) such that a discontinuity in the current coded frame group is introduced, the coded frame processing algorithm currently is unaware; the track buffers' "last decode timestamp", "last frame duration", "highest end timestamp", "need random access point flag", and the sourcebuffer's segment parser loop's "group start timestamp" and "group end timestamp" are neither consulted nor updated.

Lack of discontinuity logic execution in these cases could cause a decode sequence whose coded frames' decode dependencies are incorrect due to disjoint appends prior to and after the remove()'d range incorrectly being assumed to be a coherent coded frame group without any discontinuity or "need for a random access point".
Comment 1 Matt Wolenetz 2015-04-24 19:58:11 UTC
I'm thinking the most conservative/safest approach would be to inspect each track buffer's "last decode timestamp" and "highest end timestamp", and if the range removal algorithm removes any coded frames from a track buffer with decode timestamp == that track's last decode timestamp, then run similar steps as the coded frame processing algorithm does upon detecting an append discontinuity:
1) If mode equals "segments": Set group end timestamp to presentation timestamp.
2) If mode equals "sequence": Set group start timestamp equal to the group end timestamp.
3) Unset the last decode timestamp on all track buffers.
4) Unset the last frame duration on all track buffers.
5) Unset the highest end timestamp on all track buffers.
6) Set the need random access point flag on all track buffers to true.

I'll try similar in a Chromium CL to see if this solves the immediate known problem (as part of http://crbug.com/229412) and put together a spec pull request containing updates once prototyped in Chromium.

In the meantime, I'm open, of course, to any discussion of alternatives.
Comment 2 Matt Wolenetz 2015-04-24 21:00:31 UTC
In addition to remove() and coded frame eviction potentially removing frames and causing discontinuity, the duration change algorithm (when it truncates duration) may also introduce discontinuity by removing coded frames near the end of the current coded frame group.

Also, a more general (I think equivalent), condition to trigger the discontinuity logic (instead of "track buffer's last decode timestamp == DTS of frame being removed") would be: "track buffer's last decode timestamp is within the (inclusive) range [lowest DTS of a removed frame from that track buffer, highest DTS of a removed frame from that track buffer]" in the coded frame removal algorithm. In practice, this might make implementations that manage continuous (in DTS sequence) track buffer coded frame ranges more efficient at detecting discontinuities introduced by range removal algorithm.
Comment 3 Matt Wolenetz 2015-10-13 23:07:46 UTC
This bug has been migrated to the GitHub issue tracker. Please follow/update progress using the GitHub issue:
https://github.com/w3c/media-source/issues/23