Buffer up to 5 milliseconds of audio, or at minimum 1024 samples, each
call. Also pre-allocate the buffer, rather than using a stack buffer.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This is an unnecessary step, and results in the offset being off by the
duration of the first pre-read block. This is incorrect.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The Vorbis, Opus, MAD MPEG, and especially the FFmpeg inputs needed to
have their metadata update intervals severely reduced, to reduce CPU
usage, especially on files with lots of tags. Interval reduced to only
once per second.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
readAudio now returns an AudioChunk object directly, and all inputs have
been changed to accomodate this. Also, input and converter processing
have been altered to better work with this.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This redesign completely changes how tags are stored in memory. Now all
arbitrary tag names are supported, where possible. Some extra work will
be needed to support arbitrary tags with TagLib, such as replacing it
with a different library.
Translation pending for a couple of strings.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Matroska files use the "TITLE" field for the album when there are
chapters. Also, Matroska container uses shorter gain field names for
album and track gain, differentiating them by either being global or
specific to each chapter.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Enable playback of video file extensions. Like other video formats
handled by the FFmpeg decoder, video streams are dropped in decode and
only the first audio stream is played.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Add support for more file name extensions, so we don't fall back on
Core Audio Input for these files.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Don't post a metadata event on open, because inputs will relay it to the
player as an early notification bubble, which is unwanted.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This is essential for chapters, as otherwise, we would be skipping an
awful lot of samples every chapter, or every seek within a chapter.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Determine the length of the file from the container, rather than the
individual audio stream. The former is more likely to be set than the
latter is.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Now read all metadata and signal it, and also support pre-buffering
a small block of sample frames if there is embedded artwork, since the
embedded artwork must be handled by the sample decode function.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Add support for plain "genre" tag, in addition to the previously
supported "icy-genre" field for streams, this one is for static files.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Most file formats the player supports may or may not have UTF-8 safe
strings in their metadata. This should not be assumed to be UTF-8, and
when it is assumed, it results in nil NSString objects, which results in
inline initializers crashing due to uncaught exceptions.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Apparently, Info.plist, as generated by Xcode, is perfectly fine with
raw apostrophes in the source code, and doesn't require it to be an XML
entity.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
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>
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>
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>
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>
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>
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>
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>
... 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>