From a769d099e2b0369560c53abcfd58799a07f2b22f Mon Sep 17 00:00:00 2001 From: Vanilagy <1696106+Vanilagy@users.noreply.github.com> Date: Tue, 2 Sep 2025 16:50:59 +0200 Subject: [PATCH] Fix UrlSource for small files --- src/source.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/source.ts b/src/source.ts index 4283eab..a262bf6 100644 --- a/src/source.ts +++ b/src/source.ts @@ -316,7 +316,7 @@ export class UrlSource extends Source { if (response.status === 206) { fileSize = this._getPartialLengthFromRangeResponse(response); - worker = this._orchestrator.createWorker(0, URL_SOURCE_MIN_LOAD_AMOUNT); + worker = this._orchestrator.createWorker(0, Math.min(fileSize, URL_SOURCE_MIN_LOAD_AMOUNT)); } else { // Server probably returned a 200.