Commit 101fb90
authored
fix: calculate EXT-X-START TIME-OFFSET from actual playlist end for live streams (#1599)
For live streams with negative TIME-OFFSET in EXT-X-START, the offset
was incorrectly calculated from seekableEnd, which already has
liveEdgeDelay subtracted. This caused playback to start further behind
the live edge than intended.
Per HLS spec, negative TIME-OFFSET should be relative to the end of the
last Media Segment. This fix adds liveEdgeDelay back to seekableEnd
before applying the offset, making VHS behavior consistent with native
HLS implementations (e.g., Safari).
Example: With liveEdgeDelay=18 and TIME-OFFSET=-18:
- Before: startPoint = seekableEnd - 18 (36s behind actual live edge)
- After: startPoint = seekableEnd (18s behind, matching Safari)1 parent bd810ea commit 101fb90
File tree
3 files changed
+48
-1
lines changed- src
- test
- manifests
3 files changed
+48
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
1224 | | - | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1225 | 1233 | | |
1226 | 1234 | | |
1227 | 1235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
488 | 512 | | |
489 | 513 | | |
490 | 514 | | |
| |||
0 commit comments