Fixed multiple avconvs/ffmpeg processes still staying alive

This commit is contained in:
Amish Shah
2015-12-12 21:04:30 +00:00
parent 4d43867206
commit c2cf1badfd
2 changed files with 8 additions and 4 deletions

View File

@@ -92,6 +92,8 @@ var VoiceConnection = (function (_EventEmitter) {
this.playing = false;
this.playingIntent = null;
if (this.streamProc) {
this.streamProc.stdin.pause();
this.streamProc.kill("SIGINT");
this.streamProc.kill();
}
if (this.instream) {
@@ -129,7 +131,7 @@ var VoiceConnection = (function (_EventEmitter) {
if (!self.playingIntent || !self.playing) {
self.setSpeaking(false);
retStream.emit("end");
console.log("ending 1");
//console.log("ending 1");
return;
}
try {
@@ -140,7 +142,7 @@ var VoiceConnection = (function (_EventEmitter) {
if (onWarning) {
retStream.emit("end");
self.setSpeaking(false);
console.log("ending 2");
//console.log("ending 2");
return;
} else {
onWarning = true;

View File

@@ -63,6 +63,8 @@ export default class VoiceConnection extends EventEmitter {
this.playing = false;
this.playingIntent = null;
if (this.streamProc) {
this.streamProc.stdin.pause();
this.streamProc.kill("SIGINT");
this.streamProc.kill();
}
if(this.instream){
@@ -99,7 +101,7 @@ export default class VoiceConnection extends EventEmitter {
if (!self.playingIntent || !self.playing) {
self.setSpeaking(false);
retStream.emit("end");
console.log("ending 1");
//console.log("ending 1");
return;
}
try {
@@ -110,7 +112,7 @@ export default class VoiceConnection extends EventEmitter {
if (onWarning) {
retStream.emit("end");
self.setSpeaking(false);
console.log("ending 2");
//console.log("ending 2");
return;
} else {
onWarning = true;