mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-12 20:25:06 +01:00
stream: use descriptive variables for i/o for better readability
This commit is contained in:
parent
aabde229ed
commit
58f7ed7827
1 changed files with 7 additions and 4 deletions
|
@ -88,12 +88,13 @@ export async function streamLiveRender(streamInfo, res) {
|
||||||
'pipe', 'pipe'
|
'pipe', 'pipe'
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
const [,,, audioInput, muxOutput] = process.stdio;
|
||||||
|
|
||||||
res.setHeader('Connection', 'keep-alive');
|
res.setHeader('Connection', 'keep-alive');
|
||||||
res.setHeader('Content-Disposition', contentDisposition(streamInfo.filename));
|
res.setHeader('Content-Disposition', contentDisposition(streamInfo.filename));
|
||||||
|
|
||||||
pipe(audio, process.stdio[3], shutdown);
|
pipe(audio, audioInput, shutdown);
|
||||||
pipe(process.stdio[4], res, shutdown);
|
pipe(muxOutput, res, shutdown);
|
||||||
|
|
||||||
process.on('close', shutdown);
|
process.on('close', shutdown);
|
||||||
res.on('finish', shutdown);
|
res.on('finish', shutdown);
|
||||||
|
@ -137,10 +138,11 @@ export function streamAudioOnly(streamInfo, res) {
|
||||||
'pipe'
|
'pipe'
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
const [,,, muxOutput] = process.stdio;
|
||||||
res.setHeader('Connection', 'keep-alive');
|
res.setHeader('Connection', 'keep-alive');
|
||||||
res.setHeader('Content-Disposition', contentDisposition(`${streamInfo.filename}.${streamInfo.audioFormat}`));
|
res.setHeader('Content-Disposition', contentDisposition(`${streamInfo.filename}.${streamInfo.audioFormat}`));
|
||||||
|
|
||||||
pipe(process.stdio[3], res, shutdown);
|
pipe(muxOutput, res, shutdown);
|
||||||
res.on('finish', shutdown);
|
res.on('finish', shutdown);
|
||||||
} catch {
|
} catch {
|
||||||
shutdown();
|
shutdown();
|
||||||
|
@ -169,10 +171,11 @@ export function streamVideoOnly(streamInfo, res) {
|
||||||
'pipe'
|
'pipe'
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
const [,,, muxOutput] = process.stdio;
|
||||||
res.setHeader('Connection', 'keep-alive');
|
res.setHeader('Connection', 'keep-alive');
|
||||||
res.setHeader('Content-Disposition', contentDisposition(streamInfo.filename));
|
res.setHeader('Content-Disposition', contentDisposition(streamInfo.filename));
|
||||||
|
|
||||||
pipe(process.stdio[3], res, shutdown);
|
pipe(muxOutput, res, shutdown);
|
||||||
|
|
||||||
process.on('close', shutdown);
|
process.on('close', shutdown);
|
||||||
res.on('finish', shutdown);
|
res.on('finish', shutdown);
|
||||||
|
|
Loading…
Reference in a new issue