more clean up

This commit is contained in:
wukko 2023-02-13 20:42:16 +06:00
parent ff9f2c5cce
commit 3617382bb0

View file

@ -15,10 +15,10 @@ export function streamDefault(streamInfo, res) {
}, },
isStream: true isStream: true
}); });
stream.pipe(res).on('error', (err) => { stream.pipe(res).on('error', () => {
res.end(); res.end();
}); });
stream.on('error', (err) => { stream.on('error', () => {
res.end(); res.end();
}); });
} catch (e) { } catch (e) {
@ -57,7 +57,7 @@ export function streamLiveRender(streamInfo, res) {
ffmpegProcess.on('exit', () => ffmpegProcess.kill()); ffmpegProcess.on('exit', () => ffmpegProcess.kill());
res.on('finish', () => ffmpegProcess.kill()); res.on('finish', () => ffmpegProcess.kill());
res.on('close', () => ffmpegProcess.kill()); res.on('close', () => ffmpegProcess.kill());
ffmpegProcess.on('error', (err) => { ffmpegProcess.on('error', () => {
ffmpegProcess.kill(); ffmpegProcess.kill();
res.end(); res.end();
}); });
@ -101,7 +101,7 @@ export function streamAudioOnly(streamInfo, res) {
ffmpegProcess.on('exit', () => ffmpegProcess.kill()); ffmpegProcess.on('exit', () => ffmpegProcess.kill());
res.on('finish', () => ffmpegProcess.kill()); res.on('finish', () => ffmpegProcess.kill());
res.on('close', () => ffmpegProcess.kill()); res.on('close', () => ffmpegProcess.kill());
ffmpegProcess.on('error', (err) => { ffmpegProcess.on('error', () => {
ffmpegProcess.kill(); ffmpegProcess.kill();
res.end(); res.end();
}); });
@ -134,7 +134,7 @@ export function streamVideoOnly(streamInfo, res) {
ffmpegProcess.on('exit', () => ffmpegProcess.kill()); ffmpegProcess.on('exit', () => ffmpegProcess.kill());
res.on('finish', () => ffmpegProcess.kill()); res.on('finish', () => ffmpegProcess.kill());
res.on('close', () => ffmpegProcess.kill()); res.on('close', () => ffmpegProcess.kill());
ffmpegProcess.on('error', (err) => { ffmpegProcess.on('error', () => {
ffmpegProcess.kill(); ffmpegProcess.kill();
res.end(); res.end();
}); });