voice: fix _writeCallback being called multiple times (#2567)

This commit is contained in:
Amish Shah
2018-06-13 21:06:50 +01:00
parent 3bfc1ff61c
commit 04618f554f

View File

@@ -199,7 +199,10 @@ class StreamDispatcher extends Writable {
} }
_step(done) { _step(done) {
this._writeCallback = done; this._writeCallback = () => {
this._writeCallback = null;
done();
};
if (this.pausedSince) return; if (this.pausedSince) return;
if (!this.streams.broadcast) { if (!this.streams.broadcast) {
const next = FRAME_LENGTH + (this.count * FRAME_LENGTH) - (Date.now() - this.startTime - this.pausedTime); const next = FRAME_LENGTH + (this.count * FRAME_LENGTH) - (Date.now() - this.startTime - this.pausedTime);