CUE reader was crashing due to nil metadata pointers, which the new
inplace initializer I was using didn't like. Change it to use a mutable
regular dictionary, and only add items if they're not nil.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Now file hint stashes the whole file in memory, so that any other
threads reading the file at the same time will just grab the same memory
block and read it, rather than opening the file repeatedly.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Two were potential memory leaks on file errors, one was a guaranteed
leak when reading metadata.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The same file may be accessed from other threads, thanks to this cache
thing. Synchronize access so that only one thread is reading the file at
a time.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The SID decoder uses a hint cache so that when the library requests the
current file open, it will return the exact file already opened, rather
than opening it again. Unfortunately, I was closing the file regardless,
and sometimes, libsidplayfp will reopen the file multiple times, from
other threads, even.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Where TagLib is not being employed, use FFmpeg to read tags where
possible. This allows reading tags from files like IFF. It reads it
through properties, otherwise allowing tag readers to function like
usual.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
When decoder is redirected to the internal silence decoder, show an icon
on the playlist indicating a playback error.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Implement support for DFF, WSD, and IFF formats, and all DSD formats
carried within, using our own DSD decimation method instead of relying
on FFmpeg to do it.
Fixes#165
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
When feeding packet to decoder, attempt to retry another packet when it
reports invalid data.
Fixes#97
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Instead of rendering the ReplayGain values into the stream on decode, as
it did before. This allows exposing the values to the properties dialog.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
These events were split up in handling after this driver fell out of
use. It needed updating with the latest split handling design.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Among the changes, range checking on lots of things, and especially,
the pre-render-loop backlog handler, which rendered samples left over
from the previous call, would possibly over-render by way too much, due
to a stupid backwards subtraction I managed to type into there. This is
totally fixed now.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The dynamic metadata functions should only activate for unseekable
streams, not seekable streams, and not local files.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Sample format can now change dynamically at play time, and the player
will resample it as necessary, extrapolating edges between changes to
reduce the potential for gaps.
Currently supported formats for this:
- FLAC
- Ogg Vorbis
- Any format supported by FFmpeg, such as MP3 or AAC
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Channel config should not contain duplicate channels, or unsupported
channels. Also fix a memory leak from not freeing the AudioChannelLayout
structure allocated previously.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This implements channel masks for inputs where applicable, namely the
CoreAudio decoder, FFmpeg, FLAC, and WavPack. All others will still use
guessing from the channel number.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This fixes a possible crash with seeking operations, especially with
Audio Unit plugins. Fix implemented in foo_midi and imported here.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Tiny files complete fetching within the scope of the open function, so
the URL session task would have completed already. Now the function will
accept the data, and allow reading it.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The timing of block based mode was kind of off. Now it should be just
fine. Thanks to testing on Windows in foo_midi.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This bug prevented zero length or unknown length files, such as FLAC
files with no sample count in the header, or audio streams, from playing
properly, and clipped their output to the 0 samples indicated by the
field. Now it will simply allow wrapped files to decode until they stop
producing output.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Replace "midi.plugin" with "midiPlugin", as per the value naming
conventions that Apple set out. Migrate the old value if found.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
File channel remapping was incorrectly only working for 1-7 channel
files, not 8 channel files. Fixed that.
PLEASE NOTE: This will be my last commit and build for over a week, I
promised myself I would stop, and this is the last straw. These are the
last two, I promise. No more bug fixes this week, until at least the 7th
of February. Please, I'm begging you.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
... also disable use of AudioToolbox codecs, and use only bundled codecs
and libfdk-aac for AAC input. This is required for HLS at least, as
Apple's system codecs didn't really like the network streams that were
provided by HLS streaming stations.
Also reshuffle the input priorities between Core Audio input and FFmpeg
input, so that they were the way they were before I messed with things a
while back. This puts FFmpeg back at the top, using bundled codecs where
supported.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The built-in M3U container parser should not be used for HLS playlists,
so they should end up in the playlist as-is, so that inputs can parse
them in real time.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
If there's no configured SoundFont bank, or if the selected bank has
gone missing, and the user has configured the player to use the
FluidSynth driver, fall back to the system DLS Synthesizer, which has
its own Roland bank to fall back on if unconfigured.
Also, whether falling back, or already on an AU synthesizer, don't fail
if there's no bank configured or found. DLS doesn't explicitly require a
bank, and most other synthesizers of interest would not require a bank
either.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The file prober in FFmpeg expects that when the read function reaches
end of file, it returns AVERROR_EOF, not zero. Otherwise, it will loop
endlessly until the process is terminated.
Fixes#217.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
For some incredibly dumb reason, PSF files get into FFmpeg 5.0, then
just sit there and lock up, reading them forever and ever, doing nothing
useful. Add a bodge to detect PSF files by signature and ignore them in
the VGMStream container parser, and all other parts of VGMStream in Cog.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>