Skip to content

Simplify transports module role by making a parser's indexRange imply a requirement - #1945

Open
peaBerberian wants to merge 3 commits into
fix/patch-init-data-unusable-psshfrom
fix/dash-index-range-segment-base
Open

peaBerberian wants to merge 3 commits into
fix/patch-init-data-unusable-psshfrom
fix/dash-index-range-segment-base

Conversation

@peaBerberian

Copy link
Copy Markdown
Collaborator

Based on #1941

With SegmentTemplate, SegmentList and SegmentTimeline, the MPD already lists all segments. Yet when the MPD also had an indexRange, we requested the index bytes with the initialization segment and parsed the sidx in it. The segment list we got from it was then ignored.

Since #1939, reading that sidx can fail on malformed data, and that error stops playback (or disables subtitles for the Period). So such contents could now fail where they played before, because of a sidx we don't even use.

I now only keep indexRange for SegmentBase, where we need the sidx to know the segments.

To note that dash.js does the opposite: when an indexRange is present, it uses the sidx to get the segments, even with SegmentTemplate or SegmentList (see dash.js issue 1457). shaka-player and Media3 ignore indexRange outside of SegmentBase, like we now do.

@github-actions

Copy link
Copy Markdown

✅ Automated performance checks have passed on commit f2524963cee3824b63b41976bb9b01d871bbc078 with the base branch fix/patch-init-data-unusable-pssh.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
DASH JS parser - regular manifest (20 parses) 36.19ms -> 35.44ms (corrected: 0.542ms, A/A bias: 0.206ms, z: 0.74093) 34.60ms -> 34.10ms (corrected: 0.650ms, A/A bias: -0.050ms, z: 1.03442)
DASH WASM parser - regular manifest (20 parses) 16.55ms -> 16.38ms (corrected: -0.194ms, A/A bias: 0.364ms, z: 0.49075) 15.30ms -> 14.80ms (corrected: 0.525ms, A/A bias: 0.100ms, z: 0.70725)
DASH JS parser - many AdaptationSets (20 parses) 22.71ms -> 22.30ms (corrected: 0.536ms, A/A bias: -0.133ms, z: 0.87565) 21.20ms -> 21.15ms (corrected: -0.250ms, A/A bias: 0.400ms, z: 0.09141)
DASH WASM parser - many AdaptationSets (20 parses) 14.94ms -> 14.95ms (corrected: -0.032ms, A/A bias: 0.019ms, z: 0.14434) 14.20ms -> 14.20ms (corrected: 0.050ms, A/A bias: 0.000ms, z: 1.05366)
DASH JS parser - short SegmentTimeline (100 parses) 5.58ms -> 5.62ms (corrected: -0.057ms, A/A bias: 0.020ms, z: 0.36084) 5.50ms -> 5.50ms (corrected: -0.100ms, A/A bias: 0.100ms, z: 0.69282)
DASH WASM parser - short SegmentTimeline (100 parses) 3.62ms -> 3.63ms (corrected: -0.010ms, A/A bias: -0.003ms, z: 0.23575) 3.50ms -> 3.50ms (corrected: 0.050ms, A/A bias: -0.050ms, z: 0.44264)
DASH JS parser - medium SegmentTimeline (4 parses) 7.45ms -> 7.54ms (corrected: -0.045ms, A/A bias: -0.044ms, z: 0.27905) 7.20ms -> 7.20ms (corrected: 0.050ms, A/A bias: -0.050ms, z: 0.64952)
DASH WASM parser - medium SegmentTimeline (4 parses) 3.34ms -> 3.35ms (corrected: -0.055ms, A/A bias: 0.045ms, z: 1.63583) 3.20ms -> 3.10ms (corrected: 0.025ms, A/A bias: 0.000ms, z: 0.09623)
DASH JS parser - eight-hour SegmentTimeline (1 parse) 81.85ms -> 83.42ms (corrected: -2.180ms, A/A bias: 0.606ms, z: 0.83235) 76.05ms -> 76.90ms (corrected: -7.775ms, A/A bias: 6.050ms, z: 0.83235)
DASH WASM parser - eight-hour SegmentTimeline (1 parse) 39.11ms -> 39.91ms (corrected: -0.403ms, A/A bias: -0.404ms, z: 0.62065) 33.00ms -> 32.90ms (corrected: 1.975ms, A/A bias: -2.150ms, z: 0.62065)
loading 23.50ms -> 23.21ms (corrected: 0.226ms, A/A bias: 0.065ms, z: 0.08660) 18.20ms -> 18.20ms (corrected: 0.300ms, A/A bias: -0.050ms, z: 1.41451)
seeking 18.26ms -> 10.61ms (corrected: 7.617ms, A/A bias: 0.040ms, z: 1.19319) 7.50ms -> 7.40ms (corrected: 0.150ms, A/A bias: -0.000ms, z: 1.76573)
audio-track-reload 27.29ms -> 27.21ms (corrected: 0.285ms, A/A bias: -0.211ms, z: 1.51073) 26.40ms -> 26.30ms (corrected: 0.375ms, A/A bias: -0.150ms, z: 1.65507)
loading over active content 14.51ms -> 14.89ms (corrected: -0.409ms, A/A bias: 0.028ms, z: 0.44745) 12.70ms -> 13.20ms (corrected: -0.725ms, A/A bias: -0.800ms, z: 0.44745)
large multi-period manifest 75.56ms -> 76.30ms (corrected: 0.375ms, A/A bias: -1.116ms, z: 0.32235) 69.20ms -> 69.85ms (corrected: -3.075ms, A/A bias: 0.725ms, z: 0.32235)
cold loading multithread 49.91ms -> 49.11ms (corrected: 1.087ms, A/A bias: -0.285ms, z: 2.80977) 48.80ms -> 48.10ms (corrected: 0.975ms, A/A bias: -0.100ms, z: 4.22428)
seeking multithread 112.78ms -> 120.21ms (corrected: -12.141ms, A/A bias: 4.706ms, z: 0.22132) 7.20ms -> 7.20ms (corrected: 0.050ms, A/A bias: -0.050ms, z: 0.95263)
audio-track-reload multithread 26.81ms -> 26.89ms (corrected: 0.160ms, A/A bias: -0.239ms, z: 0.47150) 26.25ms -> 26.10ms (corrected: 0.375ms, A/A bias: -0.325ms, z: 1.05366)
hot loading multithread 16.05ms -> 16.04ms (corrected: -0.023ms, A/A bias: 0.035ms, z: 0.19245) 15.70ms -> 15.60ms (corrected: -0.050ms, A/A bias: 0.050ms, z: 0.25019)

peaBerberian and others added 3 commits December 1, 2026 16:32
With SegmentTemplate, SegmentList and SegmentTimeline, the MPD already
lists all segments. Still, when the MPD also had an `indexRange`, we
requested the index bytes with the initialization segment and parsed
the `sidx` in it. The segment list we got from it was then ignored.

Since #1939, reading that `sidx` can fail on malformed data, and that
error stops playback (or disables subtitles for the Period). So such
contents could now fail where they played before, because of a `sidx`
we don't even use.

I now only keep `indexRange` for SegmentBase, where we need the `sidx`
to know the segments.

To note that dash.js does the opposite: when an `indexRange` is
present, it uses the `sidx` to get the segments, even with
SegmentTemplate or SegmentList (see dash.js issue 1457). shaka-player
and Media3 ignore `indexRange` outside of SegmentBase, like we now do.
@peaBerberian
peaBerberian force-pushed the fix/dash-index-range-segment-base branch from beff4d3 to 7ab85a0 Compare December 1, 2026 15:33
@peaBerberian
peaBerberian force-pushed the fix/patch-init-data-unusable-pssh branch from 1f66504 to 900de3f Compare December 1, 2026 15:33
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

✅ Automated performance checks have passed on commit 217037f32e6645cb1acc8c9b2e1d94410f894870 with the base branch fix/patch-init-data-unusable-pssh.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
DASH JS parser - regular manifest (20 parses) 22.89ms -> 22.75ms (corrected: -0.080ms, A/A bias: 0.223ms, z: 0.22132) 21.80ms -> 21.75ms (corrected: -0.225ms, A/A bias: 0.325ms, z: 0.79386)
DASH WASM parser - regular manifest (20 parses) 10.71ms -> 10.61ms (corrected: 0.269ms, A/A bias: -0.177ms, z: 1.23649) 10.40ms -> 10.30ms (corrected: 0.350ms, A/A bias: -0.175ms, z: 1.11621)
DASH JS parser - many AdaptationSets (20 parses) 15.64ms -> 15.25ms (corrected: 0.578ms, A/A bias: -0.184ms, z: 1.81384) 14.85ms -> 14.50ms (corrected: 0.475ms, A/A bias: -0.075ms, z: 0.80348)
DASH WASM parser - many AdaptationSets (20 parses) 10.49ms -> 10.51ms (corrected: -0.123ms, A/A bias: 0.108ms, z: 0.44264) 10.00ms -> 10.00ms (corrected: -0.075ms, A/A bias: 0.075ms, z: 0.06736)
DASH JS parser - short SegmentTimeline (100 parses) 3.68ms -> 3.71ms (corrected: -0.023ms, A/A bias: -0.013ms, z: 1.35196) 3.50ms -> 3.50ms (corrected: -0.050ms, A/A bias: 0.050ms, z: 0.55329)
DASH WASM parser - short SegmentTimeline (100 parses) 2.43ms -> 2.43ms (corrected: 0.010ms, A/A bias: -0.016ms, z: 0.01925) 2.20ms -> 2.20ms (corrected: 0.000ms, A/A bias: 0.000ms, z: 0.15396)
DASH JS parser - medium SegmentTimeline (4 parses) 4.42ms -> 4.47ms (corrected: -0.003ms, A/A bias: -0.046ms, z: 0.40415) 4.10ms -> 4.10ms (corrected: 0.075ms, A/A bias: -0.025ms, z: 1.51073)
DASH WASM parser - medium SegmentTimeline (4 parses) 2.17ms -> 2.14ms (corrected: 0.048ms, A/A bias: -0.022ms, z: 0.98631) 2.00ms -> 2.00ms (corrected: 0.025ms, A/A bias: -0.025ms, z: 0.25019)
DASH JS parser - eight-hour SegmentTimeline (1 parse) 50.20ms -> 51.04ms (corrected: -0.869ms, A/A bias: 0.031ms, z: 0.30792) 45.85ms -> 45.85ms (corrected: 0.275ms, A/A bias: -0.675ms, z: 0.30792)
DASH WASM parser - eight-hour SegmentTimeline (1 parse) 25.98ms -> 26.30ms (corrected: -0.840ms, A/A bias: 0.518ms, z: 0.36566) 21.25ms -> 21.35ms (corrected: -1.600ms, A/A bias: 0.800ms, z: 0.36566)
loading 18.55ms -> 18.58ms (corrected: 0.697ms, A/A bias: -0.726ms, z: 0.36566) 14.30ms -> 14.50ms (corrected: -0.150ms, A/A bias: 0.025ms, z: 1.23168)
seeking 8.04ms -> 10.61ms (corrected: -0.092ms, A/A bias: -2.477ms, z: 0.68320) 4.90ms -> 4.90ms (corrected: 0.000ms, A/A bias: -0.050ms, z: 0.12028)
audio-track-reload 19.98ms -> 19.92ms (corrected: -0.191ms, A/A bias: 0.249ms, z: 0.69282) 19.00ms -> 19.10ms (corrected: 0.025ms, A/A bias: 0.025ms, z: 0.50999)
loading over active content 12.10ms -> 12.38ms (corrected: -0.761ms, A/A bias: 0.480ms, z: 0.54848) 10.70ms -> 10.70ms (corrected: -1.250ms, A/A bias: 1.150ms, z: 0.54848)
large multi-period manifest 56.43ms -> 56.05ms (corrected: -0.291ms, A/A bias: 0.665ms, z: 0.04330) 51.80ms -> 51.60ms (corrected: -2.600ms, A/A bias: 4.975ms, z: 0.04330)
cold loading multithread 36.26ms -> 35.86ms (corrected: 0.565ms, A/A bias: -0.168ms, z: 1.94856) 35.80ms -> 35.25ms (corrected: 0.650ms, A/A bias: -0.050ms, z: 2.95892)
seeking multithread 55.12ms -> 32.59ms (corrected: 2.403ms, A/A bias: 20.126ms, z: 0.47150) 4.70ms -> 4.70ms (corrected: 0.025ms, A/A bias: -0.025ms, z: 0.03849)
audio-track-reload multithread 18.95ms -> 19.04ms (corrected: 0.040ms, A/A bias: -0.133ms, z: 0.27905) 18.70ms -> 18.50ms (corrected: 0.150ms, A/A bias: -0.100ms, z: 0.94301)
hot loading multithread 13.39ms -> 13.23ms (corrected: -0.066ms, A/A bias: 0.223ms, z: 0.15396) 13.10ms -> 13.10ms (corrected: -0.025ms, A/A bias: 0.025ms, z: 0.35122)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant