api/stream: add isHLS to stream cache

This commit is contained in:
wukko 2024-10-28 15:15:41 +06:00
parent a46e04358a
commit 24ae08b105
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
3 changed files with 7 additions and 3 deletions

View file

@ -56,7 +56,8 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab
case "hls": case "hls":
params = { params = {
type: Array.isArray(r.urls) ? "merge" : "remux" type: Array.isArray(r.urls) ? "merge" : "remux",
isHLS: true,
} }
break; break;

View file

@ -46,6 +46,8 @@ export function createStream(obj) {
audioBitrate: obj.audioBitrate, audioBitrate: obj.audioBitrate,
audioCopy: !!obj.audioCopy, audioCopy: !!obj.audioCopy,
audioFormat: obj.audioFormat, audioFormat: obj.audioFormat,
isHLS: obj.isHLS || false,
}; };
streamCache.set( streamCache.set(
@ -100,7 +102,8 @@ export function createInternalStream(url, obj = {}) {
service: obj.service, service: obj.service,
headers, headers,
controller, controller,
dispatcher dispatcher,
isHLS: obj.isHLS,
}); });
let streamLink = new URL('/itunnel', `http://127.0.0.1:${env.apiPort}`); let streamLink = new URL('/itunnel', `http://127.0.0.1:${env.apiPort}`);

View file

@ -101,7 +101,7 @@ const merge = (streamInfo, res) => {
args = args.concat(ffmpegArgs[format]); args = args.concat(ffmpegArgs[format]);
if (hlsExceptions.includes(streamInfo.service)) { if (hlsExceptions.includes(streamInfo.service) && streamInfo.isHLS) {
args.push('-bsf:a', 'aac_adtstoasc') args.push('-bsf:a', 'aac_adtstoasc')
} }