Files
SpotiFLAC-Mobile/lib
zarzet a4605cbdfc fix(usb): fetch a network song whole before it plays, so it keeps the USB output
The USB output opens whole local files only. A network song (NAS, server or
a computer through Link) without a copy in the prefetch cache streamed, and
a stream plays through Android's mixer: no exclusive access, and at whatever
level the DAC was left on. The cache only holds the next two songs and starts
after three seconds of play, so a tapped or skipped-to song, and any large
song still downloading when its turn came, lost the output. A tester's log
shows exactly that: "USB output not used: this song streams" after each
skip, on songs of every sample rate.

With USB bit-perfect on and its output connected, such a song now downloads
ahead of its neighbours and starts from the copy. It streams as before when
the copy cannot be kept (too large, no file extension), the download fails,
60 seconds pass, or no output is connected, which the new outputPresent
query answers so playing without a DAC does not wait. A newer play request
ends the wait at once. Waits of half a second or more, and every fallback,
are logged.
2026-11-19 17:33:57 +07:00
..