aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder (follow)
Commit message (Collapse)AuthorAgeFilesLines
* flac, oggflac: use GLib instead of utils.h/log.hMax Kellermann2008-11-214-33/+29
|
* ffmpeg: use GLib instead of log.hMax Kellermann2008-11-211-8/+11
|
* audiofile: use GLib instead of log.hMax Kellermann2008-11-211-8/+10
|
* aac: use GLib instead of utils.h/log.hMax Kellermann2008-11-211-10/+10
| | | | Removed the superfluous my_usleep() call.
* ogg: moved the "errorStr" variable into the error handlerMax Kellermann2008-11-201-1/+2
|
* aac: get rid of gcc warningsLaszlo Ashin2008-11-201-2/+2
|
* ogg: check the ov_read() return value before the vorbis_info evaluationMax Kellermann2008-11-201-7/+6
| | | | | | The ov_info() return value may be corrupt when ov_read() did not return a positive value. First check for success, then check ov_info().
* wavpack: redo using audio_format_frame_size()Laszlo Ashin2008-11-191-6/+1
| | | | Somehow we lost 600e1322 after renaming some variables in ed6f6046.
* ffmpeg: read tags from AVFormatContextViliam Mateicka2008-11-181-5/+16
| | | | | The ffmpeg library provides some of the song metadata in the AVFormatContext struct. Pass it from there to MPD.
* audiofile: fixed misplaced ifViliam Mateicka2008-11-181-2/+1
| | | | [mk: by definition, tag_new() cannot fail - removed check]
* input_stream: size==-1 means unknown sizeMax Kellermann2008-11-164-1/+10
| | | | | | Define the special value "-1" as "unknown size". Previously, there was no indicator for streams with unknown size, which might confuse some decoders.
* ffmpeg: fixed AVSEEK_SIZEMax Kellermann2008-11-161-3/+9
| | | | | | With whence==AVSEEK_SIZE, the seek function should return the file size, not the current offset. Check the return value of input_stream_seek().
* aac: detect whether to pass "uint32_t*" to NeAACDecInit2()Max Kellermann2008-11-162-7/+31
| | | | | | | | | neaacdec.h declares all arguments as "unsigned long", but internally expects uint32_t pointers. This triggers gcc warnings on 64 bit architectures. To avoid that, make configure.ac detect whether we're using Debian's corrected headers or the original libfaad headers. In any case, pass a pointer to an uint32_t, conditionally casted to "unsigned long*".
* aac: fix compiler warnings on amd64Laszlo Ashin2008-11-151-2/+2
|
* aac: don't try to free static bufferLaszlo Ashin2008-11-151-4/+0
| | | | | In 432da18e a dynamic buffer was replaced by a static one but some frees were accidently left there which caused some segfaults.
* wavpack: be more robust if the underlying stream is not seekableLászló Áshin2008-11-141-1/+5
| | | | | | | | The wavpack open function gives us an option called OPEN_STREAMING. This provides more robust and error tolerant playback, but it automatically disables seeking. (More exactly the wavpack lib will not return the length information.) So, if the stream is already not seekable we can use this option safely.
* wavpack: tolerate less decoded data than requestedLászló Áshin2008-11-141-1/+1
| | | | | Wavpack plugin doesn't stop decoding if a block couldn't be fully decoded, rather it tries to go on.
* wavpack: renamed variables and modified coding style slightlyLászló Áshin2008-11-141-80/+113
|
* mp3: fix SEEK command check after mp3_synth_and_send()Max Kellermann2008-11-131-5/+3
| | | | | | mp3 seeking was broken, because the command==SEEK check was never reached. Swap the command check order (==SEEK before !=NONE) to fix that.
* wavpack: remove commented debug messagesMax Kellermann2008-11-121-6/+1
|
* wavpack: calculate outsamplesize with audio_format_frame_size()Max Kellermann2008-11-121-5/+1
|
* ogg: revert "use ogg_fopen() instead of ogg_open()"Max Kellermann2008-11-121-6/+9
| | | | | Unfortunately, ov_fopen() is not supported by libvorbis versions older than 1.2.
* aac: shift the input buffer before the full checkMax Kellermann2008-11-121-4/+5
| | | | | When the buffer was full, but everything was already consumed, fillAacBuffer() would not attempt to flush and refill it.
* aac: make the input buffer staticMax Kellermann2008-11-121-9/+4
| | | | Allocate the input buffer within the AacBuffer struct.
* aac: reject SEEK commandsMax Kellermann2008-11-121-1/+3
| | | | | | The aac plugin does not support seeking. Reject SEEK requests by calling decoder_seek_error(). Quit the plugin's main loop only when STOP is received.
* aac: get decoder command from decoder_data()Max Kellermann2008-11-121-4/+5
| | | | Removed a superfluous decoder_get_command() call.
* aac: convert audio_format to temporary variableMax Kellermann2008-11-121-5/+6
| | | | | | The audio_format variable is only used and initialized for decoder_initialized(). Move it into that block to save some bytes on the stack.
* aac: removed method file_decode()Max Kellermann2008-11-121-124/+1
| | | | | aac_stream_decode() was basically copy+pasted from aac_decode(). Since stream_decode() can also decode files, eliminate aac_decode().
* aac: check the buffer length in the ADIF parserMax Kellermann2008-11-121-0/+6
| | | | Check whether enough data has been read yet.
* aac: use unsigned integers and size_t where appropriateMax Kellermann2008-11-121-5/+6
|
* aac: check if the stream is seekable before length checkMax Kellermann2008-11-121-1/+2
| | | | | If the stream is not seekable, don't try to decode all frames to find out the total song time.
* aac: removed attribute "atEof"Max Kellermann2008-11-121-14/+7
| | | | Use input_stream_eof() instead.
* mpc: assume the result fo of mpc_decoder_decode() is unsignedMax Kellermann2008-11-121-2/+2
| | | | | | | According to the documentation, mpc_decoder_decode() returns an mpc_uint32_t. Since the special return value (mpc_uint32_t)-1 translates to a very large long integer, this may cause segmentation faults if not interpreted properly.
* mpc: don't assume the stream is stereoMax Kellermann2008-11-121-2/+1
| | | | Don't hard-code the factor "2".
* mpc: get decoder command from decoder_data()Max Kellermann2008-11-121-12/+9
| | | | Removed 3 superfluous decoder_get_command() invocations.
* mpc: moved code to mpc_to_mpd_buffer()Max Kellermann2008-11-121-14/+12
| | | | | mpc_to_mpd_buffer() converts a whole chunk at a time. This eliminates 3 local variables in mpc_decode().
* mpc: make the buffer large enough for one mpc frameMax Kellermann2008-11-121-28/+11
| | | | | | 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.
* mpc: use GLib instead of utils.h/log.hMax Kellermann2008-11-121-9/+6
| | | | Don't use deprecated MPD libraries.
* mpc: declare buffer as int32_t[]Max Kellermann2008-11-121-4/+4
| | | | | The buffer is always casted to int32_t* anyway; declare it as int32_t array, and remove the cast.
* mpc: eliminated the local variable "eof"Max Kellermann2008-11-111-8/+3
| | | | | Since each "eof=true" is followed by "break", the variable is superfluous.
* ogg: removed stray "}"Max Kellermann2008-11-111-1/+0
| | | | | Due to an unnoticed merge error, there was a superfluous "}". Remove it.
* ogg: use ogg_fopen() instead of ogg_open()Max Kellermann2008-11-111-8/+6
| | | | Move the reponsibility for freeing the file handle to libvorbis.
* ogg: use GLib instead of utils.h/log.hMax Kellermann2008-11-111-6/+8
|
* ogg: get decoder command from decoder_data()Max Kellermann2008-11-111-9/+8
| | | | Eliminate two decoder_get_command() invocations from the main loop.
* ogg: flush buffer after every ov_read() callMax Kellermann2008-11-111-25/+10
| | | | | Don't let the buffer grow until it is full, flush it whenever there is data available.
* mp3: support stream tagsMax Kellermann2008-11-111-1/+8
| | | | | | | 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.
* mp3: eliminated duplicate command checkMax Kellermann2008-11-111-18/+20
| | | | | | | 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.
* oggflac: removed the obsolete try_decode() methodMax Kellermann2008-11-111-6/+3
|
* decoder: return void from decode() methodsMax Kellermann2008-11-1111-85/+46
| | | | | | | | 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.
* replay_gain: converted struct replay_gain_info elements to an arrayMax Kellermann2008-11-115-22/+22
| | | | | Having an array instead of individual variables allows the use of the replay_gain_mode enum as an array index.