mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
voice: resolve "cb is not a function" error (#2317)
This commit is contained in:
@@ -140,7 +140,7 @@ class StreamDispatcher extends Writable {
|
|||||||
if (!this.pausedSince) return;
|
if (!this.pausedSince) return;
|
||||||
this._pausedTime += Date.now() - this.pausedSince;
|
this._pausedTime += Date.now() - this.pausedSince;
|
||||||
this.pausedSince = null;
|
this.pausedSince = null;
|
||||||
if (this._writeCallback) this._writeCallback();
|
if (typeof this._writeCallback === 'function') this._writeCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -195,13 +195,11 @@ class StreamDispatcher extends Writable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_step(done) {
|
_step(done) {
|
||||||
if (this.pausedSince) {
|
this._writeCallback = done;
|
||||||
this._writeCallback = done;
|
if (this.pausedSince) return;
|
||||||
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);
|
||||||
setTimeout(done.bind(this), next);
|
setTimeout(this._writeCallback.bind(this), next);
|
||||||
}
|
}
|
||||||
this._sdata.sequence++;
|
this._sdata.sequence++;
|
||||||
this._sdata.timestamp += TIMESTAMP_INC;
|
this._sdata.timestamp += TIMESTAMP_INC;
|
||||||
|
|||||||
Reference in New Issue
Block a user