This commit is contained in:
Travis CI 2017-01-07 21:11:38 +00:00
parent 140e45c933
commit f8990bc68a
2 changed files with 4 additions and 7 deletions

View file

@ -22933,6 +22933,7 @@ class VoiceBroadcast extends EventEmitter {
if (this.currentTranscoder) { if (this.currentTranscoder) {
if (this.currentTranscoder.transcoder) this.currentTranscoder.transcoder.kill(); if (this.currentTranscoder.transcoder) this.currentTranscoder.transcoder.kill();
this.currentTranscoder = null; this.currentTranscoder = null;
this.emit('end');
} }
} }
@ -23007,10 +23008,7 @@ class VoiceBroadcast extends EventEmitter {
* Emitted once the broadcast (the audio stream) ends * Emitted once the broadcast (the audio stream) ends
* @event VoiceBroadcast#end * @event VoiceBroadcast#end
*/ */
transcoder.once('end', () => { transcoder.once('end', () => this.killCurrentTranscoder());
this.emit('end');
this.killCurrentTranscoder();
});
this.currentTranscoder = { this.currentTranscoder = {
transcoder, transcoder,
options, options,
@ -23027,7 +23025,6 @@ class VoiceBroadcast extends EventEmitter {
*/ */
playConvertedStream(stream, { seek = 0, volume = 1, passes = 1 } = {}) { playConvertedStream(stream, { seek = 0, volume = 1, passes = 1 } = {}) {
this.killCurrentTranscoder(); this.killCurrentTranscoder();
stream.once('end', () => this.emit('end'));
const options = { seek, volume, passes, stream }; const options = { seek, volume, passes, stream };
this.currentTranscoder = { options }; this.currentTranscoder = { options };
stream.once('readable', () => this._startPlaying()); stream.once('readable', () => this._startPlaying());

File diff suppressed because one or more lines are too long