aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* mp4: pass struct mp4_context to the mp4ff_callback_t methodsMax Kellermann2008-11-041-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.
* mp4: use GLib instead of utils.h / log.hMax Kellermann2008-11-041-13/+14
| | | | Replace deprecated code with GLib.
* mp4: use tag_is_empty() instead of passing the tag_is_found flagMax Kellermann2008-11-041-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.
* mp4: static mp4ff_callback_t variablesMax Kellermann2008-11-041-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().
* mp4: no CamelCaseeMax Kellermann2008-11-041-104/+109
| | | | Renamed functions and variables.
* ffmpeg: removed loop from mpd_ffmpeg_read()Max Kellermann2008-11-041-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.
* ffmpeg: removed ffmpeg_context.codecMax Kellermann2008-11-041-2/+0
| | | | | That variable is never used except during initialization in ffmpeg_helper().
* ffmpeg: moved code to ffmpeg_find_audio_stream()Max Kellermann2008-11-041-9/+12
|
* ffmpeg: no CamelCaseMax Kellermann2008-11-041-100/+101
| | | | Renamed variables.
* decoder_api: automatically send stream tagMax Kellermann2008-11-032-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.
* mod: removed boolean globals for lazy initMax Kellermann2008-11-031-15/+4
| | | | | The variables mod_mikModInitiated and mod_mikModInitError were used to control lazy initialization, but they are superfluous now.
* mod: always initialize libmikmodMax Kellermann2008-11-031-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.
* ffmpeg: fix boolean inversion in ffmpeg_tag()Max Kellermann2008-11-021-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.
* ffmpeg: don't rewind stream in url_close()Max Kellermann2008-11-021-4/+0
| | | | | Rewinding the stream here is not useful, but may consume valuable resources (and time).
* decoder: rewind input stream after try_decode()Max Kellermann2008-11-022-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.
* ffmpeg: use decoder_read() wrapper instead of direct input_stream_read()Max Kellermann2008-11-021-1/+2
| | | | | decoder_read() checks the decoder command. Without this patch, the ffmpeg plugin could become unresponsive.
* ogg, ffmpeg: try to decode, even when the stream is not seekableMax Kellermann2008-11-023-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.
* decoder_api: added decoder_tag()Max Kellermann2008-11-021-2/+6
| | | | Provide an API for submitting additional tags from the stream.
* aac, mod: moved decoder command check into loop conditionMax Kellermann2008-11-022-18/+9
| | | | | Avoid while(true) loops, and convert them to a loop with a proper condition.
* aac, mod: don't check for SEEK commandMax Kellermann2008-11-022-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.
* decoder_api: pass "seekable" flag to decoder_initialized()Max Kellermann2008-11-0212-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.
* decoder: make the suffixes and mime_types arrays really constMax Kellermann2008-11-0111-32/+41
| | | | | The strings were constant, but the pointers weren't. C syntax is somewhat tricky..
* decoder: make all decoder_plugin structs constMax Kellermann2008-11-0111-12/+12
| | | | | All decoder_plugin structs are initialized at compile time, and must never change.
* decoder_api: pass constant path pointersMax Kellermann2008-10-3111-27/+41
|
* added prefix to header macrosMax Kellermann2008-10-312-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.
* ogg: don't include _flac_common.hMax Kellermann2008-10-311-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.
* oggflac: adapt to new APIMax Kellermann2008-10-311-6/+6
| | | | | Again, I forgot to adapt oggflac to the new API (struct input_stream, bool return values).
* ffmpeg: pass input_stream pointer to decoder_data()Max Kellermann2008-10-301-3/+5
| | | | | decoder_data() uses wait times to let the input stream continue its transfer.
* ffmpeg: use return value of decoder_data()Max Kellermann2008-10-301-18/+20
| | | | | decoder_data() always returns the current command. If we use this, we can save a lot of decoder_get_command() calls.
* ffmpeg: output buffer size cannot be negativeMax Kellermann2008-10-301-5/+7
| | | | Converted the runtime check to an assertion.
* ffmpeg: break immediately after av_read_frame()Max Kellermann2008-10-301-9/+8
| | | | Remove one indent level.
* ffmpeg: moved code to ffmpeg_send_frame()Max Kellermann2008-10-301-27/+34
| | | | | Move code from ffmpeg_decode_internal() to make it smaller and more readable.
* ffmpeg: report seek errors to MPDMax Kellermann2008-10-301-5/+4
| | | | | The decoder API provides the function decoder_seek_error() to report seek errors. Use this function instead of logging the error.
* ffmpeg: simplified mpdurl_read()Max Kellermann2008-10-301-13/+11
| | | | | The function mpdurl_read() is too complicated, and uses the wrong data types.
* ffmpeg: call tag_free() instead of free()Max Kellermann2008-10-301-1/+1
| | | | | tag objects must be freed with tag_free() to ensure that all resources are freed.
* ffmpeg: eliminated local variable "tag"Max Kellermann2008-10-301-7/+4
| | | | | The function ffmpeg_tag() already has the variable base.tag, which can be used for this.
* ffmpeg: make ffmpeg_helper() return boolMax Kellermann2008-10-301-24/+21
| | | | | ffmpeg_try_decode() did not interpret ffmpeg_helper()'s return value properly; migrate everything to bool to make it consistent.
* ffmpeg: removed debug messagesMax Kellermann2008-10-301-35/+5
| | | | We don't need those anymore, they just fill the log.
* ffmpeg: initialize base.decoderMax Kellermann2008-10-301-0/+1
| | | | | ffmpeg_tag() did not initialize base.decoder, which made valgrind unhappy, and can lead to a egmentation fault.
* mpc: provide 24 bit samplesMax Kellermann2008-10-301-7/+6
| | | | | | Similar to libmad, libmpcdec provides samples with higher quality than 16 bit. Send 24 bit samples to MPD, which allows MPD to apply dithering just in case the output devices are only 16 bit capable.
* mpc: moved sample size into a constantMax Kellermann2008-10-301-5/+9
| | | | Don't hard-code the "16 bits" or "2 bytes" in multiple locations.
* mpc: renamed variable "s16" to "dest"Max Kellermann2008-10-301-5/+4
| | | | | The name "s16" implies 16 bit integers. To make the code more generic, rename it to "dest".
* mpc: fix broken integer sample conversionMax Kellermann2008-10-301-6/+4
| | | | | | The conversion of integer samples was completely broken, which presumably didn't annoy anybody because libmpcdec provides float samples on most installations.
* mpc: fix boolean interpretation of input_stream_seek()Max Kellermann2008-10-301-1/+1
| | | | | When input_stream_seek() was converted to return a bool, this wasn't adjusted in the musepack plugin.
* decoder: use bool for return values and flagsMax Kellermann2008-10-3011-114/+119
| | | | | Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
* mp3: make mp3_read() return boolMax Kellermann2008-10-301-19/+7
| | | | | | | Its only caller in mp3_decode() just compared its value with DECODE_BREAK. Convert that to bool, and return false if the loop should be ended. Also eliminate some superfluous command checking code, which was already done in the preceding while loop.
* decoder: automatically flush the output buffer after decoder exitsMax Kellermann2008-10-299-23/+0
| | | | | | | A decoder_flush() invocation was missing in the FLAC plugin, resulting in casual assertion failures due to a wrong assumption about the last chunk's audio format. It's much easier to remove that decoder_flush() function and make the decoder thread call ob_flush().
* decoder_api: removed decoder_clear()Max Kellermann2008-10-298-16/+3
| | | | | Call ob_clear() in decoder_command_finished() instead of implementing that call in every decoder plugin.
* mp3: seek in backgroundMax Kellermann2008-10-291-5/+7
| | | | | | | | | | Remember the seek_where argument and call decoder_command_finished() immediately. This way, the player thread can continue working, and we can receive more commands. This also fixes several issues which resulted in broken frames, leading to erroneos "elapsed" values: frames weren't parsed properly, since the code was checking for command!=NONE.
* mp3: return from mp3_synth_and_send() on any commandMax Kellermann2008-10-291-2/+2
| | | | | Previously, the function would only return when a STOP was issued. It makes more sense to consider all possible commands.