aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-11-05wavpack: read_bytes() should not return after partial readsMax Kellermann1-1/+16
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.
2008-11-05wavpack: don't close the streamMax Kellermann1-1/+0
The input_stream object is opened and closed by the caller.
2008-11-04decoder: removed stream_typesMax Kellermann11-12/+0
Instead of checking the stream_types bit set, we can simply check whether the methods stream_decode() and file_decode() are implemented.
2008-11-04wavpack: removed NULL element from tagtypesMax Kellermann1-3/+2
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.
2008-11-04wavpack: use enum tag_typeMax Kellermann1-1/+1
Don't store tag type values in a plain integer, use the proper enum.
2008-11-04wavpack: use GLib instead of utils.h / log.hMax Kellermann1-28/+12
Replace deprecated code with GLib.
2008-11-04wavpack: read first byte from wvc streamMax Kellermann1-25/+13
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.
2008-11-04wavpack: use the bool data typeMax Kellermann1-12/+12
Use boolean true/false instead of 1/0.
2008-11-04wavpack: no CamelCaseMax Kellermann1-42/+44
Renamed functions and variables.
2008-11-04wavpack: fix indentMax Kellermann1-47/+47
Fixed the indent of the switch statement in format_samples_int().
2008-11-04mp4: get decoder command from decoder_data()Max Kellermann1-7/+8
Eliminate a superfluous decoder_get_command() call. decoder_data() already returns the command.
2008-11-04mp4: initialize audio_format before decoder_initialized()Max Kellermann1-6/+5
Removed the duplicate audio_format initialization.
2008-11-04mp4: use decoder_read() instead of input_stream_read()Max Kellermann1-1/+4
decoder_read() handles decoder commands, and should be used in decoder plugins.
2008-11-04mp4: pass struct mp4_context to the mp4ff_callback_t methodsMax Kellermann1-10/+18
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.
2008-11-04mp4: use GLib instead of utils.h / log.hMax Kellermann1-13/+14
Replace deprecated code with GLib.
2008-11-04mp4: use tag_is_empty() instead of passing the tag_is_found flagMax Kellermann1-13/+3
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.
2008-11-04mp4: static mp4ff_callback_t variablesMax Kellermann1-22/+15
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().
2008-11-04mp4: no CamelCaseeMax Kellermann1-104/+109
Renamed functions and variables.
2008-11-04ffmpeg: removed loop from mpd_ffmpeg_read()Max Kellermann1-15/+2
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.
2008-11-04ffmpeg: removed ffmpeg_context.codecMax Kellermann1-2/+0
That variable is never used except during initialization in ffmpeg_helper().
2008-11-04ffmpeg: moved code to ffmpeg_find_audio_stream()Max Kellermann1-9/+12
2008-11-04ffmpeg: no CamelCaseMax Kellermann1-100/+101
Renamed variables.
2008-11-03decoder_api: automatically send stream tagMax Kellermann2-51/+5
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.
2008-11-03mod: removed boolean globals for lazy initMax Kellermann1-15/+4
The variables mod_mikModInitiated and mod_mikModInitError were used to control lazy initialization, but they are superfluous now.
2008-11-03mod: always initialize libmikmodMax Kellermann1-8/+1
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.
2008-11-02ffmpeg: fix boolean inversion in ffmpeg_tag()Max Kellermann1-1/+1
ffmpeg_tag() deleted the tag when ffmpeg_helper() returned success. The return value was interpreted incorrectly, it should return the tag on success.
2008-11-02ffmpeg: don't rewind stream in url_close()Max Kellermann1-4/+0
Rewinding the stream here is not useful, but may consume valuable resources (and time).
2008-11-02decoder: rewind input stream after try_decode()Max Kellermann2-8/+0
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.
2008-11-02ffmpeg: use decoder_read() wrapper instead of direct input_stream_read()Max Kellermann1-1/+2
decoder_read() checks the decoder command. Without this patch, the ffmpeg plugin could become unresponsive.
2008-11-02ogg, ffmpeg: try to decode, even when the stream is not seekableMax Kellermann3-11/+1
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.
2008-11-02decoder_api: added decoder_tag()Max Kellermann1-2/+6
Provide an API for submitting additional tags from the stream.
2008-11-02aac, mod: moved decoder command check into loop conditionMax Kellermann2-18/+9
Avoid while(true) loops, and convert them to a loop with a proper condition.
2008-11-02aac, mod: don't check for SEEK commandMax Kellermann2-18/+2
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.
2008-11-02decoder_api: pass "seekable" flag to decoder_initialized()Max Kellermann12-23/+27
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.
2008-11-01decoder: make the suffixes and mime_types arrays really constMax Kellermann11-32/+41
The strings were constant, but the pointers weren't. C syntax is somewhat tricky..
2008-11-01decoder: make all decoder_plugin structs constMax Kellermann11-12/+12
All decoder_plugin structs are initialized at compile time, and must never change.
2008-10-31decoder_api: pass constant path pointersMax Kellermann11-27/+41
2008-10-31added prefix to header macrosMax Kellermann2-4/+4
"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.
2008-10-31ogg: don't include _flac_common.hMax Kellermann1-1/+0
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.
2008-10-31oggflac: adapt to new APIMax Kellermann1-6/+6
Again, I forgot to adapt oggflac to the new API (struct input_stream, bool return values).
2008-10-30ffmpeg: pass input_stream pointer to decoder_data()Max Kellermann1-3/+5
decoder_data() uses wait times to let the input stream continue its transfer.
2008-10-30ffmpeg: use return value of decoder_data()Max Kellermann1-18/+20
decoder_data() always returns the current command. If we use this, we can save a lot of decoder_get_command() calls.
2008-10-30ffmpeg: output buffer size cannot be negativeMax Kellermann1-5/+7
Converted the runtime check to an assertion.
2008-10-30ffmpeg: break immediately after av_read_frame()Max Kellermann1-9/+8
Remove one indent level.
2008-10-30ffmpeg: moved code to ffmpeg_send_frame()Max Kellermann1-27/+34
Move code from ffmpeg_decode_internal() to make it smaller and more readable.
2008-10-30ffmpeg: report seek errors to MPDMax Kellermann1-5/+4
The decoder API provides the function decoder_seek_error() to report seek errors. Use this function instead of logging the error.
2008-10-30ffmpeg: simplified mpdurl_read()Max Kellermann1-13/+11
The function mpdurl_read() is too complicated, and uses the wrong data types.
2008-10-30ffmpeg: call tag_free() instead of free()Max Kellermann1-1/+1
tag objects must be freed with tag_free() to ensure that all resources are freed.
2008-10-30ffmpeg: eliminated local variable "tag"Max Kellermann1-7/+4
The function ffmpeg_tag() already has the variable base.tag, which can be used for this.
2008-10-30ffmpeg: make ffmpeg_helper() return boolMax Kellermann1-24/+21
ffmpeg_try_decode() did not interpret ffmpeg_helper()'s return value properly; migrate everything to bool to make it consistent.