Commit Graph

695 Commits (e1fa8d1e9b52ce82eac49c8e9d3344385e728419)

Author SHA1 Message Date
Christopher Snowhill 7f7e17a410 Correct capitalization of WavPack in codec info
Report the correct codec name for WavPack files. An info refresh will be
needed for it to take effect on existing playlist entries.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-04 02:08:55 -08:00
Christopher Snowhill b3247578ed MAD Decoder: Comment out unused variable
A variable wasn't being used, except in debug builds. Comment out its
use and only skip over the field in the LAME header.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 20:52:35 -08:00
Christopher Snowhill a978dfbf5a MAD Decoder: Fix MP3 decoding crash
There was a stupid bug in the previous commit I made, which caused local
or seekable MP3 files to crash the player on decode. This fixes that, by
checking that a packet has actually been decoded before touching the
packet info structures. Dumb, dumb, dumb error on my part.

Fixes #244

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 04:26:12 -08:00
Christopher Snowhill ca3dec4497 MAD Decoder: Support changing format
Support the weird scenario of format changes mid-stream. Probably
highly unlikely, and likely to break things if it does occur, but
whatever, it might actually happen in some weird file.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:43:54 -08:00
Christopher Snowhill 53209485c0 MAD Decoder: Correctly prepare buffer after free
The current buffer size argument is used to determine if a buffer should
be allocated on the next run. Just in case something reuses the same
decoder instance.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:38:17 -08:00
Christopher Snowhill 6b53a87784 Clean up a couple of warning notices on this file
There were several warnings due to the capitalization of the header
paths, and due to unused functions that are only required by the text
CUESheet parser, and we're only using the CUESheet generator, which has
been heavily modified to emit NSString output rather than a file on
disk.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:11:50 -08:00
Christopher Snowhill 2c0f04bbeb Possibly improve MAD sample conversion speed
No idea if this brings a noticeable improvement, but it probably makes
better sense to only do the division step one time instead of doing it
twice interleaved when processing stereo files, which are the most
common scenario anyway.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:08:55 -08:00
Christopher Snowhill 19556cc630 Brought back the MAD plugin from death
Now Cog supports freeformat MP3 once again. The plugin has been extended
to include sample accurate seeking, accurate length probing of files
missing headers, and iTunes gapless info reading using libid3tag.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-24 17:51:10 -08:00
Christopher Snowhill 90ed02302e Fix FFmpeg handling odd WMA files, at least
This small change brings the decoding more in line with what ffplay
does, and allows, for example, John McLaughlin.wma to play without
interruption from the stream warnings throughout the file.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-20 03:14:30 -08:00
Christopher Snowhill 81f5adfb5c Fix Info.plist having bare apostrophes
Xcode touched the Info.plist and fixed these, and I changed the file
type association definitions to print the correct thing in the future.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-20 01:51:11 -08:00
Christopher Snowhill 7f3bf052ca Update supported file name extensions for art
Art read from external files supports more formats than previously
listed here. Amend the list accordingly.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 01:56:34 -08:00
Christopher Snowhill 8c945b53de HTTP Reader: Guess encoding type of stream info
Stream metadata could be in any encoding, not necessarily UTF-8. Handle
this in an appropriate way.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 01:51:16 -08:00
Christopher Snowhill 0d4ee4c901 VGMStream Input: Remove downmixing, add layout
Downmixing should no longer be necessary, unless someone actually tries
to emit up to 64 channels, while we support only 32 channels, but really
only 18 channels. Also read the channel layout field from the decoder,
so that the speaker layout will propagate from the files to the player.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 22:55:34 -08:00
Christopher Snowhill 3274bc9fe7 Revert "HTTP Reader: Support more stream info"
This reverts commit 33388918b3.
2022-02-15 15:00:11 -08:00
Christopher Snowhill 33388918b3 HTTP Reader: Support more stream info
For streams offering a three way split in their ICY metadata blocks,
support album/artist/title using that three way split. Otherwise do the
usual of artist/title, or blank artist if there's no hyphen to split on.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 00:57:22 -08:00
Christopher Snowhill 5e8f066a01 Add include path for libogg
The new libogg directory must be included for <ogg/ogg.h> in one place.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 00:40:47 -08:00
Christopher Snowhill f071d3e90c Build several libraries out of tree now
Building libogg, libvorbis, libvorbisfile, libFLAC, libopus, and
libopusfile out of tree, to utilize their projects' CMake build scripts,
and also enable any platform optimizations that may have been missing.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 00:26:55 -08:00
Christopher Snowhill 934589ebdd FFmpeg: Enable AIFF support
The system AIFF reader seems unable to read some really old files, so
enable FFmpeg to do so instead.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 21:09:24 -08:00
Christopher Snowhill a8c9f748c7 FLAC Input: Correctly prioritize text CUESheet tag
Prioritize "cuesheet" Vorbis tag over binary CUESheet tag, as the former
can contain metadata, while the latter cannot.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 19:54:08 -08:00
Christopher Snowhill cad09b8912 CUE Reader: Fix enumerating sheets and tag reading
The reader should have been skipping the properties of CUE sheets when
reading the referenced data for the inner files.

Fixes #235

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-13 12:18:58 -08:00
Christopher Snowhill 1309672adc CUE Sheet Reader: Merge metadata the other way
The file metadata should be merged into the CUE Sheet metadata, as we
want the CUE Sheet to take priority, wherever it happens to have fields
set.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-12 07:57:13 -08:00
Christopher Snowhill a618073203 Highly Complete: Keep USF RSP HLE disabled for now
There is a missing effect in the relevant tracks from Conker's Bad Fur
Day, an overdrive effect.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-12 07:45:10 -08:00
Christopher Snowhill a05d4537c1 Various tagging fixes
- Fix Vorbis, Opus, and FLAC tag reading
- Fix Vorbis getting a 0 length if passing through the CUE Sheet reader
- Implement support for FLAC binary CUE Sheets

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-12 07:16:59 -08:00
Christopher Snowhill 1df166b060 Updated lazyusf2, and disabled RSP HLE warnings
The warn logging was preventing working USFs from playing due
to warnings occurring during the playback that didn't otherwise
affect the ability to play the files.
2022-02-12 03:29:43 -08:00
Christopher Snowhill d5aecaf6a2 Fix outstanding crashes and issues with CUE reader
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>
2022-02-11 06:49:41 -08:00
Christopher Snowhill e695e33537 SID Input: Bring back file hints, better this time
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>
2022-02-11 04:43:20 -08:00
Christopher Snowhill 425306129f SID Input: Clean up memory leaks
Two were potential memory leaks on file errors, one was a guaranteed
leak when reading metadata.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-11 04:19:27 -08:00
Christopher Snowhill b40b8521dd SID Input: Open the files for decoding regardless
No more file handle caching, this was probably a source of crashes.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-11 04:18:39 -08:00
Christopher Snowhill 4f5e5a9e4e SID Input: Synchronize cross file access
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>
2022-02-11 03:56:50 -08:00
Christopher Snowhill be6fda4663 SID Input: Don't close hinted source files
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>
2022-02-11 03:55:26 -08:00
Christopher Snowhill 68c3f3b1d8 Highly Complete: Disable USF HLE
The HLE is incomplete, and sometimes buggy. Disable it for now.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 20:57:44 -08:00
Christopher Snowhill 39dcb88728 FFmpeg input: Support reading metadata
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>
2022-02-10 15:29:13 -08:00
Christopher Snowhill 5ff1f95481 Add decoder open error indicator
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>
2022-02-10 02:15:48 -08:00
Christopher Snowhill f203911bb1 FFmpeg Input: Support various DSD formats and IFF
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>
2022-02-10 00:32:24 -08:00
Christopher Snowhill 085891aff1 FFmpeg Input: Retry on decode error
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>
2022-02-09 22:37:39 -08:00
Christopher Snowhill 4cdf919b45 Opus Input: Now reads ReplayGain tags
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>
2022-02-09 21:27:33 -08:00
Christopher Snowhill c3cd4c34f4 MIDI Plugin: Rearrange project source files
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-09 18:43:01 -08:00
Christopher Snowhill a212c85252 MIDI Plugin: Fix stupid typo
Damn, how did I miss this one?

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-09 18:38:12 -08:00
Christopher Snowhill b03702e164 MIDI Plugin: Fix BASSMIDI driver SysEx handling
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>
2022-02-09 18:36:37 -08:00
Christopher Snowhill 808b14a358 MIDI Plugin: Vital changes for stability
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>
2022-02-09 18:29:34 -08:00
Christopher Snowhill e2e83ea760 FFmpeg/FLAC/Opus/Vorbis Inputs: Fix metadata
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>
2022-02-09 15:04:49 -08:00
Christopher Snowhill 0012d1b17e Implement dynamic metadata reading for streams
Supported by FFmpeg, FLAC, Ogg Vorbis, and Opus.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-09 13:44:50 -08:00
Christopher Snowhill 69506cd1d7 HTTP Reader: Replaced implementation with libCURL
New implementation largely based on the vfs_curl module from DeaDBeeF.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-09 13:41:01 -08:00
Christopher Snowhill e13f83609e FFmpeg Input: Implement stream metadata reading
Now reads Icy interval metadata and timed ID3v2 tags.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-08 21:34:28 -08:00
Christopher Snowhill 7cea254f4c Implement framework for dynamic metadata updates
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-08 21:21:53 -08:00
Christopher Snowhill b927f4c02b Replace more NSDictionary use with literals
Use literals to initialize fixed NSDictionary objects in various places.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-08 19:56:04 -08:00
Christopher Snowhill 838b31a6e8 MIDI: Replaced FluidSynth with BASSMIDI again
FluidSynth is just too unstable, and also just bad in general.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-08 18:29:03 -08:00
Christopher Snowhill 4fd24838fa FFmpeg Input: Fix format changes
Format changes should only occur on whole packet intervals.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-07 19:37:06 -08:00
Christopher Snowhill 477feaab1d Now properly supports sample format changing
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>
2022-02-07 19:18:45 -08:00
Christopher Snowhill b2177fccbc Core Audio input: Fix channel config, and a leak
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>
2022-02-07 02:47:32 -08:00