From 24ae08b1050fb78f3dd6776617e69027014c6122 Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 28 Oct 2024 15:15:41 +0600 Subject: [PATCH] api/stream: add `isHLS` to stream cache --- api/src/processing/match-action.js | 3 ++- api/src/stream/manage.js | 5 ++++- api/src/stream/types.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/src/processing/match-action.js b/api/src/processing/match-action.js index 578a5218..a502c6d2 100644 --- a/api/src/processing/match-action.js +++ b/api/src/processing/match-action.js @@ -56,7 +56,8 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab case "hls": params = { - type: Array.isArray(r.urls) ? "merge" : "remux" + type: Array.isArray(r.urls) ? "merge" : "remux", + isHLS: true, } break; diff --git a/api/src/stream/manage.js b/api/src/stream/manage.js index 557caa55..5f55b5fa 100644 --- a/api/src/stream/manage.js +++ b/api/src/stream/manage.js @@ -46,6 +46,8 @@ export function createStream(obj) { audioBitrate: obj.audioBitrate, audioCopy: !!obj.audioCopy, audioFormat: obj.audioFormat, + + isHLS: obj.isHLS || false, }; streamCache.set( @@ -100,7 +102,8 @@ export function createInternalStream(url, obj = {}) { service: obj.service, headers, controller, - dispatcher + dispatcher, + isHLS: obj.isHLS, }); let streamLink = new URL('/itunnel', `http://127.0.0.1:${env.apiPort}`); diff --git a/api/src/stream/types.js b/api/src/stream/types.js index 184af873..2a1b9677 100644 --- a/api/src/stream/types.js +++ b/api/src/stream/types.js @@ -101,7 +101,7 @@ const merge = (streamInfo, res) => { args = args.concat(ffmpegArgs[format]); - if (hlsExceptions.includes(streamInfo.service)) { + if (hlsExceptions.includes(streamInfo.service) && streamInfo.isHLS) { args.push('-bsf:a', 'aac_adtstoasc') }