mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
fix: auto-play next song — set ffmpeg=null on close, handle async playNext
Two bugs prevented auto-advance: 1. FFmpeg close handler was empty — ChildProcess object persisted after close, so frame loop check `!this.ffmpeg` never triggered trackEnd 2. playNext() is async (resolves URL) but trackEnd handler didn't catch rejected promises, causing silent failures Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5c4c7051d7
commit
4c71a0a37f
2 files changed
+7
-3
No files matched your search
+1
-1
@@ -79,7 +79,7 @@ export class AudioPlayer extends EventEmitter {
|
||||
});
|
||||
|
||||
this.ffmpeg.on("close", () => {
|
||||
// Let frame loop drain remaining buffer
|
||||
this.ffmpeg = null; // Signal frame loop that no more data is coming
|
||||
});
|
||||
|
||||
this.ffmpeg.on("error", (err) => {
|
||||
|
||||
Reference in new issue
Block a user