Thanks to upstream VGMStream for fixing this in the Audacious plugin,
which I derived this code from in the first place, which explains the
memory leak getting in.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Raw DSD is counting frames in bytes, not bits/samples, so it needs to be
scaled up when dividing by the raw sample rate.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
It's regarded as unstable as some plugins randomly decide to overflow
the main thread queue and crash the player on the main thread check, but
only sometimes, and not always.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Move the stack-based buffer, which is rather large, to the player class
instance, where it will be allocated on the heap.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Improve rendering functions of Audio Unit player, and also fix looping
for the Audio Unit player, and any other possible future players which
use blocked decoding with timestamped events.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Also hide the Apple plugins from settings so they don't get activated
unless there's no SoundFont configured.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
BASSMIDI: 2.4.15.3
BASSFLAC: 2.4.5.5
BASSOPUS: 2.4.3
BASSWV: 2.4.7.4
WavPack: 5.8.1
And updated the WavPack plugin to support threaded decoding, using up to
four worker threads, as detected from the host machine's CPU count.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The streaming support was breaking because initial packet detection was
failing due to bit reservoir errors. Instead, detect consecutive sync
frames in the initial read buffer, then attempt to sync to a decodable
frame in the first block of data, otherwise give up.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Add missing HLS MIME type: audio/mpegurl
Update FFmpeg to version 7.1.1, carrying the same patches, and one new
patch: Implementing support for HLS ID3 tags changing mid-stream.
We cannot do away with fdk-aac yet, because the USAC codec is missing
features that fdk-aac implements already.
Fixes#428
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Move minimp3 packet decoder state into the decoder_ex state structure,
instead of using the redundant duplicate structure. Also reduce input
buffer size for streams to 16KiB, and actually use the defined macro in
the header file to declare the streaming buffer size.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Seeking should clear the sample buffer if it contains anything, and non-
seekable files should return an error on an attempt to seek.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
There were several issues which broke debug and possibly release
signing, and broke VGMStream in debug situations. Not sure if it was
also broken in release.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
libMAD had memory safety issues, possibly with corrupt files. Hopefully,
this will fix the problem.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Move this commonly used string decoding helper to the CogAudio framework
and import it in every plugin that uses it.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Now it handles multiple attached pictures and tries to pick out the one
which may be the front cover picture, or otherwise picks the first one.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Improve handling where FFmpeg may call the provided file reader with
AVSEEK_SIZE repeatedly, when file size is not likely to change between
repeated calls. This prevents repeated seek operations that would
otherwise be required to probe the file size each time.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Cleaned up project settings to current defaults, except for the macOS
deployment version, which is still 10.13. Cleaned up a lot of headers
and such to include with angle braces instead of double quotes. Enabled
build sandbox in a lot of places. Disabled subproject signing in several
places, for libraries and frameworks which will be stripped and signed
when they are copied into place in the final build.
Also, while trying to solve compilation issues, the visualization
controller was reverted to the Objective C implementation, which is
probably faster anyway. Stupid Swift/Objective-C language mixing issues.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Remove deprecated functions, make use of free functions that clear the
pointers before returning, etc.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Update the readers to support the newly added tag fields, and also read
the supported format list from the library itself.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Stream timestamps were correctly being converted from the monotonically
increasing frame count, but the AudioChunk parameter was being set from
the frame count rather than the converted seconds count.
Fixes#418
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Audio Chunks now have full timestamp accounting, including DSP playback
speed ratio for the one DSP that can change play ratio, Rubber Band.
Inputs which support looping and actually reporting the absolute play
position now do so.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Gah, how in heck did Xcode end up inserting an absolute
path? Fix that, and some other leftovers.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Make exception handling more robust and thorough. Never
know what may happen, make sure to handle most cases.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Both the midi_processing and the various players may
throw exceptions, so we should check for these too.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
SSEQPlayer throws exceptions, there should be exception
handling to catch them and fail gracefully.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The TagLib C++ code was missing generic try/catch handling
which could result in any generic errors throwing straight
to a full crash. Add exception handling and logging, which
will fix a logged crash regardless of whether the tags are
read correctly or not by the newer TagLib version.
Fixes#415
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
In the event of local paths containing not just UTF-8 characters,
but also un-decoded URL percent sequences, which will end up double
encoded in the player, code which reverses percent encoding should
later re-apply it.
Apparently, this whole time, since the last code overhaul, the
URL encoding was being stripped, then the file opener was converting
these paths back into URLs without re-encoding, which didn't break
until someone played an album in a folder containing a partially
decoded UTF-8 sequence. Thanks, Zophar's Domain, and whoever ripped
the Golden Sun GSF set for finding this bug!
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Since in one case, it probably wasn't combining them into one stack
allocation, it probably blew up the stack allocation quite a bit.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Change to the future render api, hopefully float support
will be available eventually. Also change to allocate the
sample buffers from the heap instead of the stack.
This is imported by the player, though it doesn't fail when it's
missing, so that would explain why I didn't spot this error sooner.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>