mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
fix some stuff
This commit is contained in:
@@ -7,9 +7,36 @@ class PCMConversionProcess extends EventEmitter {
|
||||
constructor(process) {
|
||||
super();
|
||||
this.process = process;
|
||||
this.input = null;
|
||||
this.process.on('error', e => this.emit('error', e));
|
||||
}
|
||||
|
||||
setInput(stream) {
|
||||
this.input = stream;
|
||||
stream.pipe(this.process.stdin, { end: false });
|
||||
this.input.on('error', e => this.emit('error', e));
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.emit('debug', 'destroying a ffmpeg process:');
|
||||
if (this.input && this.input.unpipe && this.process.stdin) {
|
||||
this.input.unpipe(this.process.stdin);
|
||||
this.emit('unpiped the user input stream from the process input stream');
|
||||
}
|
||||
if (this.process.stdin) {
|
||||
this.process.stdin.end();
|
||||
this.emit('ended the process stdin');
|
||||
}
|
||||
if (this.process.stdin.destroy) {
|
||||
this.process.stdin.destroy();
|
||||
this.emit('destroyed the process stdin');
|
||||
}
|
||||
if (this.process.kill) {
|
||||
this.process.kill();
|
||||
this.emit('killed the process');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FfmpegConverterEngine extends ConverterEngine {
|
||||
|
||||
Reference in New Issue
Block a user