Commit e34dbc6
committed
fix: recover from QuotaExceededError by evicting back buffer and retrying append
When a SourceBuffer append throws QuotaExceededError, intercept the error
before it propagates, evict the minimum number of back buffer segments
needed to fit the new data, and retry the append with the original data
still in memory — avoiding the re-download loop that plagues hls.js
upstream (#6776, #6711).
Eviction uses actual byte sizes from the fragment tracker rather than
time-based estimates, so the calculation is exact regardless of bitrate
or ABR level switches. If eviction + retry fails (e.g. no back buffer
to evict), falls through to the existing BUFFER_FULL_ERROR path.
Changes:
- buffer-controller: on QuotaExceededError, calculate eviction target
and queue a remove + retry append instead of emitting an error
- fragment-tracker: add getBackBufferEvictionEnd() which walks buffered
fragments oldest-first accumulating byte sizes to find the minimum
eviction point
- buffer-operation-queue: add insertNext() to queue operations after
the current one for remove-then-retry sequencing1 parent 7a45b89 commit e34dbc6
File tree
3 files changed
+120
-6
lines changed- src/controller
3 files changed
+120
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
| 856 | + | |
856 | 857 | | |
857 | 858 | | |
858 | 859 | | |
| |||
900 | 901 | | |
901 | 902 | | |
902 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
903 | 933 | | |
904 | 934 | | |
905 | 935 | | |
| |||
914 | 944 | | |
915 | 945 | | |
916 | 946 | | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
| 947 | + | |
922 | 948 | | |
923 | | - | |
| 949 | + | |
924 | 950 | | |
925 | 951 | | |
926 | 952 | | |
| |||
1198 | 1224 | | |
1199 | 1225 | | |
1200 | 1226 | | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
1201 | 1247 | | |
1202 | 1248 | | |
1203 | 1249 | | |
| |||
1940 | 1986 | | |
1941 | 1987 | | |
1942 | 1988 | | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
1943 | 1995 | | |
1944 | 1996 | | |
1945 | 1997 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
| 486 | + | |
| 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 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
485 | 539 | | |
486 | 540 | | |
487 | 541 | | |
| |||
0 commit comments