refactor(audio): engine module absorbs the hook
useAudio shrinks 928→152: backend lifecycle, poll, session restore, crash recovery, queue advance and event-bus commands live in createAudioEngine; the hook is a thin Solid adapter. audio-player: preload of a dead URL stalls the load mutex 5s — end-file (open failure) now races file-loaded.
This commit is contained in:
@@ -579,8 +579,12 @@ export class MpvBackend implements AudioBackend {
|
||||
if (pausedSeek) {
|
||||
// time-pos sent before file-loaded is silently dropped by mpv
|
||||
// (no file yet) — the preload then parked at 0 and the restore
|
||||
// position was lost. Wait for the open, then seek.
|
||||
await fileLoaded;
|
||||
// position was lost. Wait for the open, then seek. A dead URL
|
||||
// never fires file-loaded at all (mpv keeps retrying the
|
||||
// open), so end-file (the open-failure notification) races it
|
||||
// and the wait folds to "not loaded" instead of stalling the
|
||||
// load mutex for the full 5s timeout.
|
||||
await Promise.race([fileLoaded, this.conn?.waitEvent("end-file", 5000)]);
|
||||
await this.send(["set_property", "time-pos", pausedSeek]);
|
||||
this._position = pausedSeek;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user