Fix SBCL bracket-escaping in shuffle library scanner

stream-harmony.lisp:
- scan-music-library-files: use native-namestring instead of namestring
  when collecting file paths, producing real OS paths without SBCL's
  backslash escaping of brackets (e.g. [FLAC] not \[FLAC])
- Use parse-native-namestring for root directory entry point so dirs
  with brackets are not treated as wildcard patterns

cl-streamer submodule updated to d57a268:
- play-file, read-audio-metadata, play-list retry: same native-namestring
  fix to prevent double-escaping through parse-native-namestring

Fixes FLAC FILE slot unbound errors and SIGSEGV memory fault that
crashed the shuffle pipeline after consecutive failures on bracket paths.
This commit is contained in:
Glenn Thompson 2026-03-08 22:02:46 +03:00
parent 04a874ceb5
commit 2a713d7386
2 changed files with 12 additions and 4 deletions

@ -1 +1 @@
Subproject commit c0f9c0e161e2076f7dde8fdcbcb0f701d02cc35b Subproject commit d57a2683e757577a7292b63b5d3ad7016bb24187

View File

@ -307,7 +307,8 @@
(defun scan-music-library-files (&optional (directory *music-library-path*)) (defun scan-music-library-files (&optional (directory *music-library-path*))
"Recursively scan DIRECTORY for supported audio files. "Recursively scan DIRECTORY for supported audio files.
Returns a list of namestrings." Returns a list of native namestrings (real OS paths without SBCL's
bracket escaping, safe to pass through parse-native-namestring later)."
(let ((files nil) (let ((files nil)
(extensions *supported-formats*)) (extensions *supported-formats*))
(labels ((scan (dir) (labels ((scan (dir)
@ -315,7 +316,7 @@
(dolist (entry (uiop:directory-files dir)) (dolist (entry (uiop:directory-files dir))
(let ((ext (pathname-type entry))) (let ((ext (pathname-type entry)))
(when (and ext (member ext extensions :test #'string-equal)) (when (and ext (member ext extensions :test #'string-equal))
(push (namestring entry) files)))) (push (sb-ext:native-namestring entry) files))))
(error (e) (error (e)
(log:debug "Error scanning ~A: ~A" dir e))) (log:debug "Error scanning ~A: ~A" dir e)))
(handler-case (handler-case
@ -323,7 +324,14 @@
(scan sub)) (scan sub))
(error (e) (error (e)
(log:debug "Error listing subdirs of ~A: ~A" dir e))))) (log:debug "Error listing subdirs of ~A: ~A" dir e)))))
(scan (pathname directory))) ;; Use parse-native-namestring so directories with brackets (e.g.
;; "[FLAC]") are not treated as wildcard patterns by SBCL.
(scan (sb-ext:parse-native-namestring
(etypecase directory
(string directory)
(pathname (sb-ext:native-namestring directory)))
nil *default-pathname-defaults*
:as-directory t)))
(nreverse files))) (nreverse files)))
(defvar *shuffle-library-cache* nil (defvar *shuffle-library-cache* nil