mirror of
https://github.com/danbulant/discord.js
synced 2026-05-30 12:51:55 +00:00
Fix setFEC bug and use bitrateEditable in setBitrate
This commit is contained in:
parent
121a40bb4a
commit
995cd181c9
1 changed files with 2 additions and 2 deletions
|
|
@ -151,7 +151,7 @@ class StreamDispatcher extends Writable {
|
|||
* @returns {boolean} true if the bitrate has been successfully changed.
|
||||
*/
|
||||
setBitrate(value) {
|
||||
if (!value || !this.streams.opus || !this.streams.opus.setBitrate) return false;
|
||||
if (!value || !this.bitrateEditable) return false;
|
||||
const bitrate = value === 'auto' ? this.player.voiceConnection.channel.bitrate : value;
|
||||
this.streams.opus.setBitrate(bitrate * 1000);
|
||||
return true;
|
||||
|
|
@ -175,7 +175,7 @@ class StreamDispatcher extends Writable {
|
|||
*/
|
||||
setFEC(enabled) {
|
||||
if (!this.bitrateEditable) return false;
|
||||
this.streams.opus.setPLP(enabled);
|
||||
this.streams.opus.setFEC(enabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue