| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
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().
|
|
|
|
| |
Renamed functions and variables.
|
|
|
|
|
|
| |
The function decoder_read() already cares about the decoder command,
and loops until data is available. Reduced mpd_ffmpeg_read() to no
more than the decoder_read() call.
|
|
|
|
|
| |
That variable is never used except during initialization in
ffmpeg_helper().
|
| |
|
|
|
|
| |
Renamed variables.
|
|
|
|
|
|
|
|
|
|
| |
If an input stream provides tags (e.g. from an icecast server), send
them in the decoder_data() and decoder_tag() methods. Removed the
according code from the mp3 and oggvorbis plugins - decoders shouldn't
have to care about stream tags.
This patch also adds the missing decoder_tag() invocation to the mp3
plugin.
|
|
|
|
|
| |
The variables mod_mikModInitiated and mod_mikModInitError were used to
control lazy initialization, but they are superfluous now.
|
|
|
|
|
|
|
| |
The "mod" decoder plugin was being initialized lazily, but was
deinitialized unconditionally. That led to segmentation faults.
Convert mod_initMikMod() to be the global module initialization
method. The MPD core should care about lazy initialization.
|
|
|
|
|
|
| |
ffmpeg_tag() deleted the tag when ffmpeg_helper() returned success.
The return value was interpreted incorrectly, it should return the tag
on success.
|
|
|
|
|
| |
Rewinding the stream here is not useful, but may consume valuable
resources (and time).
|
|
|
|
|
|
|
|
|
| |
The try_decode() method may have read some data from the stream, which
is now lost. To make this data available to other methods, get it
back by rewinding the input stream after each try_decode() invocation.
The ogg and wavpack plugins did this manually and inconsistently; this
code can now be removed.
|
|
|
|
|
| |
decoder_read() checks the decoder command. Without this patch, the
ffmpeg plugin could become unresponsive.
|
|
|
|
|
|
|
| |
Ogg and ffmpeg detection was disabled when the stream was not
seekable, because the detection was too expensive. Since the curl
input stream can now rewind the stream cheaply, we can re-enable
detection on streams.
|
|
|
|
| |
Provide an API for submitting additional tags from the stream.
|
|
|
|
|
| |
Avoid while(true) loops, and convert them to a loop with a proper
condition.
|
|
|
|
|
|
| |
Since the aac and mod plugins have told MPD that they cannot seek, MPD
will never send a SEEK command to them. Removed the SEEK comand
checks from both plugins.
|
|
|
|
|
|
| |
Don't pass the "seekable" flag with every decoder_data() invocation.
Since that flag won't change within the file, it is enough to pass it
to decoder_initialized() once per file.
|
|
|
|
|
| |
The strings were constant, but the pointers weren't. C syntax is
somewhat tricky..
|
|
|
|
|
| |
All decoder_plugin structs are initialized at compile time, and must
never change.
|
| |
|
|
|
|
|
|
|
| |
"LOG_H" is a macro which is also used by ffmpeg/log.h. This is
ffmpeg's fault, because short macros should be reserved for
applications, but since it's always a good idea to choose prefixed
macro names, even for applications, we are going to do that in MPD.
|
|
|
|
|
|
| |
The source _ogg_common.c does not need any symbols from
_flac_common.h, but including it leads to compiler errors when libflac
isn't available.
|
|
|
|
|
| |
Again, I forgot to adapt oggflac to the new API (struct input_stream,
bool return values).
|
|
|
|
|
| |
decoder_data() uses wait times to let the input stream continue its
transfer.
|
|
|
|
|
| |
decoder_data() always returns the current command. If we use this, we
can save a lot of decoder_get_command() calls.
|
|
|
|
| |
Converted the runtime check to an assertion.
|
|
|
|
| |
Remove one indent level.
|
|
|
|
|
| |
Move code from ffmpeg_decode_internal() to make it smaller and more
readable.
|
|
|
|
|
| |
The decoder API provides the function decoder_seek_error() to report
seek errors. Use this function instead of logging the error.
|