From 459b2c8283d658daacde94891406051c926ca615 Mon Sep 17 00:00:00 2001 From: jj Date: Sun, 15 Dec 2024 17:59:36 +0000 Subject: [PATCH] api/internal-hls: don't remake chunk istreams if already wrapped --- api/src/stream/internal-hls.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/src/stream/internal-hls.js b/api/src/stream/internal-hls.js index 83deb440..55634c71 100644 --- a/api/src/stream/internal-hls.js +++ b/api/src/stream/internal-hls.js @@ -16,15 +16,17 @@ function transformObject(streamInfo, hlsObject) { let fullUrl; if (getURL(hlsObject.uri)) { - fullUrl = hlsObject.uri; + fullUrl = new URL(hlsObject.uri); } else { fullUrl = new URL(hlsObject.uri, streamInfo.url); } - hlsObject.uri = createInternalStream(fullUrl.toString(), streamInfo); + if (fullUrl.hostname !== '127.0.0.1') { + hlsObject.uri = createInternalStream(fullUrl.toString(), streamInfo); - if (hlsObject.map) { - hlsObject.map = transformObject(streamInfo, hlsObject.map); + if (hlsObject.map) { + hlsObject.map = transformObject(streamInfo, hlsObject.map); + } } return hlsObject;