mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
api/stream: add isHLS
to stream cache
This commit is contained in:
parent
a46e04358a
commit
24ae08b105
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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}`);
|
||||||
|
|
|
@ -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')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue