VLC doesn't check XDG_DATA_DIRS to look for sound fonts
Relevant source code: https://github.com/videolan/vlc/blob/5d0d2b0d533df40c6e78460d2a320997e7e3ee34/modules/codec/fluidsynth.c#L127-L145
I've a sound font within my XDG_DATA_DIRS, but VLC can't find it.
It seems like there's no code in the VLC tree at all that cares about XDG_···DIRS, though there is for many of the XDG···_DIR kind (in the singular variant).
Showcase:
s|~ % cvlc ~/code/cache/lilymusic/bach/bwv-231/bwv-231-satb.midi
VLC media player 2.2.6 Umbrella (revision 2.2.6-0-g1aae78981c)
[0000000000b06c18] dummy interface: using the dummy interface module...
[00007f530cc017f8] smf demux: Track name: control track
[00007f530cc017f8] smf demux: Text : creator:
[00007f530cc017f8] smf demux: Text : GNU LilyPond 2.18.2
[00007f530cc017f8] smf demux: Track name: :uniqueContext0
[00007f530cc017f8] smf demux: Track name: :uniqueContext1
[00007f530cc017f8] smf demux: Track name: :uniqueContext2
[00007f530cc017f8] smf demux: Track name: :uniqueContext3
[00007f530cc02648] fluidsynth decoder error: sound font file required for synthesis
[00007f530cc02648] core decoder error: MIDI synthesis not set up
[00007f530cc02648] core decoder error: A sound font file (.SF2) is required for MIDI synthesis.
Please install a sound font and configure it from the VLC preferences (Input / Codecs > Audio codecs > FluidSynth).
[00007f530cc02648] core decoder error: Codec `MIDI' (MIDI Audio) is not supported.
[00007f530cc02648] core decoder error: Codec not supported
[00007f530cc02648] core decoder error: VLC could not decode the format "MIDI" (MIDI Audio)
[00007f530cc017f8] smf demux: Track name: control track
[00007f530cc017f8] smf demux: Text : creator:
[00007f530cc017f8] smf demux: Text : GNU LilyPond 2.18.2
[00007f530cc017f8] smf demux: Track name: :uniqueContext0
[00007f530cc017f8] smf demux: Track name: :uniqueContext1
[00007f530cc017f8] smf demux: Track name: :uniqueContext2
[00007f530cc017f8] smf demux: Track name: :uniqueContext3
^C%
s|~ % tr : \\n <<< "$XDG_DATA_DIRS" | xargs -r sh -c 'find 2>/dev/null -L "$@" -name "*.sf2"' ''
/home/s/.nix-profile/share/soundfonts/FluidR3_GM2-2.sf2
^C
s|~ % echo $XDG_DATA_DIRS
/run/opengl-driver/share:/etc/per-user-pkgs/s/share:/home/s/.nix-profile/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share
I'm on NixOS and I've tagged all "Platform(s)" as "POSIX (all)". I hope I'm not mistaken in that regard.