| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
mpc_to_mpd_buffer() converts a whole chunk at a time. This eliminates
3 local variables in mpc_decode().
|
|
|
|
|
|
| |
Don't split the buffer conversion loop. When libmpcdec returns a
chunk, convert and send the whole chunk at a time. This moves several
checks out of the loop, and greatly improves performance.
|
|
|
|
| |
Don't use deprecated MPD libraries.
|
|
|
|
|
| |
The buffer is always casted to int32_t* anyway; declare it as int32_t
array, and remove the cast.
|
|
|
|
|
| |
Since each "eof=true" is followed by "break", the variable is
superfluous.
|
|
|
|
|
| |
Due to an unnoticed merge error, there was a superfluous "}". Remove
it.
|
|
|
|
| |
Move the reponsibility for freeing the file handle to libvorbis.
|
| |
|
|
|
|
| |
Eliminate two decoder_get_command() invocations from the main loop.
|
|
|
|
|
| |
Don't let the buffer grow until it is full, flush it whenever there is
data available.
|
|
|
|
|
|
|
| |
Parse ID3 tags, even when they are in the middle of the stream. Very
few streams provide embedded ID3 tags. Most of them send only
Shoutcast "icy" tags, which limits the practical usefulness of this
patch.
|
|
|
|
|
|
|
| |
When a command is received, decode_next_frame_header() and
decodeNextFrame() return DECODE_BREAK. This is already checked by
both callers, which means that we can eliminate lots of
decoder_get_command() checks.
|
| |
|
|
|
|
|
|
|
|
| |
The stream_decode() and file_decode() methods returned a boolean,
indicating whether they were able to decode the song. This is
redundant, since we already know that: if decoder_initialized() has
been called (and dc.state==DECODE), the plugin succeeded. Change both
methods to return void.
|
|
|
|
|
| |
Having an array instead of individual variables allows the use of the
replay_gain_mode enum as an array index.
|
|
|
|
|
|
| |
The function simplifies wavpack_replaygain(), because it already
contains the float parser, and it works with a fixed buffer instead of
doing expensive heap allocations.
|
|
|
|
| |
This allows us to remove the "static char[]" hack.
|
|
|
|
| |
Some code simplification. Avoid pointers to pointers.
|
|
|
|
| |
Renamed functions and variables.
|
|
|
|
|
|
| |
Instead of having a seprate try_decode() method, let the
stream_decode() and file_decode() methods decide whether they are able
to decode the song.
|
|
|
|
|
|
|
| |
The flac plugin wasn't initialized properly when an OGG file was being
decoded. For some reason, flac_process_metadata() was explicitly not
called for OGG files. Since that seems to fix the issue, make it
always call flac_process_metadata().
|
|
|
|
|
|
|
|
|
| |
Since decoder_list.c does not include the libflac headers, it cannot
know whether to add the oggflac plugin to the decoder list. Solve
this by always enabling the oggflac sub-plugin, even with older
libflac versions. When the libflac API cannot support oggflac,
disable the plugin at runtime by returning "false" from its init()
method.
|
|
|
|
|
|
| |
Wavpack's try_decode() implementation does nothing useful, it only
duplicates code already in stream_decode() / file_decode(), and slows
down MPD.
|
|
|
|
|
| |
Disable flac's "oggflac" sub-plugin when libflac does not support
ogg-flac files.
|
|
|
|
|
|
|
|
|
| |
This patch makes 24-bit samples available for mpd. I tested with the
WavPack Test Suite found on wavpack.com:
http://www.rarewares.org/wavpack/test_suite.zip
Every test file worked fine.
|
|
|
|
|
|
|
|
|
| |
At this moment the wavpack lib doesn't use the return value of the
push_back function, which has an equivalent meaning of the return
value of ungetc(). This is a lucky situation, because so far it
simply returned with 1 as a hard coded value. From now on the
function will return EOF on error. (This function makes exactly one
byte pushable back.)
|
|
|
|
|
| |
A new function has been added to do a cast and a little check in the
wavpack-mpd input stream wrapper.
|
|
|
|
|
| |
I think this makes the code more easily modifiable and prevents some
annoying mistakes.
|
|
|
|
|
|
| |
There are some functions in the wavpack-mpd input streams wrapper
which had too commonly used names (especially can_seek). I prefixed
these with "wavpack_input_".
|
|
|
|
|
| |
Not every function header has its return type in a distinct line. This
patch corrects that. This way there is more space for the arguments.
|
|
|
|
|
| |
Using wvc streams the seekableness depends on the seekability of the
wvc stream as well.
|
|
|
|
|
| |
The input stream opened for wvc is not closed in an if branch. A
close call has been added.
|
|
|
|
|
| |
Somehow seeking is disabled on all kinds of wavpack playbacks now in
the git version. This patch corrects that.
|
|
|
|
|
|
|
| |
libwavpack expects the read_bytes() stream method to fill the whole
buffer, and fails badly when we return a partial read (i.e. not enough
data available yet). This caused wavpack streams to break.
Re-implement the buffer filling loop.
|
|
|
|
| |
The input_stream object is opened and closed by the caller.
|
|
|
|
|
| |
Instead of checking the stream_types bit set, we can simply check
whether the methods stream_decode() and file_decode() are implemented.
|
|
|
|
|
| |
The number of tag types is known at compile time. Use the GLib macro
G_N_ELEMENTS instead of having a NULL element at the end.
|
|
|
|
| |
Don't store tag type values in a plain integer, use the proper enum.
|
|
|
|
| |
Replace deprecated code with GLib.
|
|
|
|
|
|
|
|
|
| |
Instead of manually waiting for the input stream to become ready (to
catch server errors), just read the first byte. Since the
wavpack_input has the capability to push back one byte, we can simply
re-feed it. Advantage is: decoder_read() handles everything for us,
i.e. waiting for the stream, polling for decoder commands and error
handling.
|
|
|
|
| |
Use boolean true/false instead of 1/0.
|
|
|
|
| |
Renamed functions and variables.
|
|
|
|
| |
Fixed the indent of the switch statement in format_samples_int().
|
|
|
|
|
| |
Eliminate a superfluous decoder_get_command() call. decoder_data()
already returns the command.
|
|
|
|
| |
Removed the duplicate audio_format initialization.
|
|
|
|
|
| |
decoder_read() handles decoder commands, and should be used in decoder
plugins.
|
|
|
|
|
|
| |
We need the decoder object, so we have to begin passing a new struct
to these callbacks, instead of only the pointer to the input_stream
object.
|
|
|
|
| |
Replace deprecated code with GLib.
|
|
|
|
|
|
|
|
| |
The API of mp4_load_tag() was strange: it always returned a tag
object, no matter if a tag was found in the file; the existence of a
tag was indicated with the tag_found integer reference. This flag is
superfluous, since we can simply check whether the tag is empty or
not.
|
|
|
|
|
|
| |
Allocate the mp4ff_callback_t object on the stack. This is easier to
handle, since we don't have to free it. Incidentally, this fixes a
memory leak in mp4_load_tag().
|