mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
cleaning
This commit is contained in:
1 parent
7fbd83f6e6
commit
b7a654fd36
1 file changed
+10
-4
+10
-4
@@ -726,18 +726,24 @@ export default class Player extends EventEmitter {
|
||||
|
||||
const onFfmpegError = (err) => {
|
||||
const ffMsg = err?.message ?? String(err);
|
||||
// "Input stream error: aborted" means NodeLink dropped the HTTP stream
|
||||
// (e.g. filter PATCH restarted the player before voice state arrived).
|
||||
// Only treat it as graceful if the track was already close to ending.
|
||||
if (ffMsg.includes("aborted") || ffMsg.includes("Input stream error")) {
|
||||
|
||||
const isGracefulKill =
|
||||
ffMsg.includes("aborted") ||
|
||||
ffMsg.includes("Input stream error") ||
|
||||
ffMsg.includes("SIGKILL") ||
|
||||
ffMsg.includes("killed with signal");
|
||||
|
||||
if (isGracefulKill) {
|
||||
if (this._didTrackMostlyFinish(currentTrack)) {
|
||||
logger.player("[Player] FFmpeg stream ended near track completion");
|
||||
cleanup();
|
||||
return resolve();
|
||||
}
|
||||
cleanup();
|
||||
if (this._streamingStopped || this._skipping) return resolve();
|
||||
return reject(new Error(`FFmpeg stream ended early: ${ffMsg}`));
|
||||
}
|
||||
|
||||
logger.error("[Player] FFmpeg error:", ffMsg);
|
||||
cleanup();
|
||||
if (this._streamingStopped || this._skipping) return resolve();
|
||||
|
||||
Reference in new issue
Block a user