aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* mp3: moved code to mp3_synth_and_send()Max Kellermann2008-10-291-60/+74
| | | | Break the large function mp3_read() into smaller pieces.
* mp3: moved code to mp3_send_pcm()Max Kellermann2008-10-291-29/+48
| | | | Break the large function mp3_read() into smaller pieces.
* mp3: moved code to mp3_update_timer_next_frame()Max Kellermann2008-10-291-16/+28
| | | | Break the large function mp3_read() into smaller pieces.
* mp3: moved code to mp3_this_frame_offset()Max Kellermann2008-10-291-10/+10
| | | | Break the large function mp3_read() into smaller pieces.
* mp3: moved code to mp3_time_to_frame()Max Kellermann2008-10-291-11/+21
| | | | Break the large function mp3_read() into smaller pieces.
* mp3: assert that the stream is seekableMax Kellermann2008-10-291-5/+5
| | | | | | dc_seek() won't send a SEEK command to the decoder thread unless the stream is seekable. No need to do another check; convert that to an assertion.
* mp3: moved code to mp3_filesize_to_song_length()Max Kellermann2008-10-281-23/+42
| | | | | The function mp3_decode_first_frame() is too large. Move some code to separate smaller functions.
* mp3: no "goto"Max Kellermann2008-10-281-19/+36
| | | | http://xkcd.com/292/
* mp3: use GLib allocation functionsMax Kellermann2008-10-281-11/+9
| | | | This removes the need for util.h.
* mp3: use boolMax Kellermann2008-10-281-50/+51
| | | | Use the C99 bool data type for boolean values.
* mp3: no CamelCaseMax Kellermann2008-10-281-255/+254
| | | | | Renamed all functions and variables. Also removed the mp3DecodeData typedef.
* mp3: remove obsolete commentsMax Kellermann2008-10-281-4/+0
|
* input_stream: convert offset and size to the off_t data typeMax Kellermann2008-10-281-1/+1
| | | | | | size_t and long aren't 64 bit safe (i.e. files larger than 2 GB on a 32 bit OS). Use off_t instead, which is a 64 bit integer if compiled with large file support.
* utils: use g_str_has_prefix() instead of prefixcmp()Max Kellermann2008-10-281-1/+2
| | | | Remove duplicated code from MPD.
* input_stream: use "bool" instead of "int"Max Kellermann2008-10-269-20/+20
| | | | | For boolean values and success flags, use bool instead of integer (1/0 for true/false, 0/-1 for success/failure).
* input_stream: no CamelCaseMax Kellermann2008-10-2610-65/+65
| | | | Renamed all functions and variables.
* input_stream: removed the InputStream typedefMax Kellermann2008-10-2612-48/+65
| | | | Everybody should use struct input_stream.
* renamed src/inputPlugins/ to src/decoder/Max Kellermann2008-10-2615-0/+5609
These plugins are not input plugins, they are decoder plugins. No CamelCase in the directory name.