Better ending

This commit is contained in:
Amish Shah
2017-10-25 23:46:05 +01:00
parent 48452173ca
commit 7f90d4ebc5

View File

@@ -103,10 +103,11 @@ class StreamDispatcher extends Writable {
destroy() {
if (this.player.dispatcher !== this) return;
this.player.dispatcher = null;
const streams = this.player.streams;
this.end();
if (streams.opus) streams.opus.unpipe(this);
if (streams.ffmpeg) streams.ffmpeg.destroy();
this.end();
}
}