From c1eda1ad56aca49a2e44cb51ec1fe232b8b2e06b Mon Sep 17 00:00:00 2001 From: james58899 Date: Sun, 12 May 2024 16:15:52 +0000 Subject: [PATCH] Patch eris missing callback cause 'end' not emit --- patches/eris+0.17.2.patch | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/patches/eris+0.17.2.patch b/patches/eris+0.17.2.patch index 7b06921..22a5b03 100644 --- a/patches/eris+0.17.2.patch +++ b/patches/eris+0.17.2.patch @@ -81,7 +81,7 @@ index 7160c6c..4d4917c 100644 super(options); this.manualCB = false; diff --git a/node_modules/eris/lib/voice/streams/OggOpusTransformer.js b/node_modules/eris/lib/voice/streams/OggOpusTransformer.js -index 6c4baed..204a05e 100644 +index 6c4baed..20cb135 100644 --- a/node_modules/eris/lib/voice/streams/OggOpusTransformer.js +++ b/node_modules/eris/lib/voice/streams/OggOpusTransformer.js @@ -8,6 +8,7 @@ class OggOpusTransformer extends BaseTransformer { @@ -114,7 +114,7 @@ index 6c4baed..204a05e 100644 this.push(segment); } } else if(byte === "OpusHead") { -@@ -71,6 +72,12 @@ class OggOpusTransformer extends BaseTransformer { +@@ -71,12 +72,19 @@ class OggOpusTransformer extends BaseTransformer { this.emit("debug", "Invalid codec: " + byte); } } @@ -126,4 +126,12 @@ index 6c4baed..204a05e 100644 + } } - _final() { +- _final() { ++ _final(cb) { + if(!this._bitstream) { + this.emit("error", new Error("No Opus stream was found")); + } ++ cb(); + } + + _transform(chunk, enc, cb) {