aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* decoder: ignore SEEK commands during initializationMax Kellermann2008-11-131-1/+4
| | | | | When the decoder receives a SEEK during initialization, it should ignore that for now. The old code made most decoders abort.
* music_pipe: check for partial frames in appended chunkMax Kellermann2008-11-131-0/+2
| | | | | Added an additional assertion which checks partial frames in the existing tail chunk.
* player: assert that there was no previous "next song chunk"Max Kellermann2008-11-131-0/+1
| | | | | When assigning the next_song_chunk variable, it must have been empty. If not, there may be 3 songs overlapping in the music pipe.
* playlist: call clearPlayerQueue() only if song is queued IIMax Kellermann2008-11-121-14/+10
| | | | | This patch extends commit 35a16b99, and amends several 2 missing checks. It simplifies 2 more checks by merging "if" conditions.
* 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
|
* decoder: fixed typo in assertionMax Kellermann2008-11-111-1/+1
| | | | | decoder_file_decode() should check for plugin->file_decode, not plugin->stream_decode().
* 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.
* player: fix race condition during tag updateMax Kellermann2008-11-111-2/+4
| | | | | | | | | When a tag is updated, the old tag was freed before the new one was created. Reverse the order to be sure that other threads always see a valid pointer. This still leaves a possible race condition, but it will be addressed later.
* playlist: track song metadata changesMax Kellermann2008-11-112-12/+14
| | | | | When the tag of the current song changes (e.g. a new tag was sent in the stream), update the playlist, so clients pick up the new tag.
* oggflac: removed the obsolete try_decode() methodMax Kellermann2008-11-111-6/+3
|
* decoder: return void from decode() methodsMax Kellermann2008-11-1113-113/+56
| | | | | | | | 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: don't include os_compat.hMax Kellermann2008-11-111-1/+3
| | | | | os_compat.h is deprecated and should be replaced with well-defined standard headers.
* replay_gain: use GLib instead of utils.h/log.hMax Kellermann2008-11-111-14/+11
| | | | Eliminated deprecated libraries.
* replay_gain: use pcm_volume() to apply replay gainMax Kellermann2008-11-111-37/+2
| | | | | | | The currently replay_gain_apply() implementation duplicates code from pcm_volume(), except that it uses a floating point scale. Eliminate all duplicated code from and make it utilize the pcm_volume() library function. This introduces replay gain support for 24 bit audio.
* pcm_utils: allow volume levels greater than 100% in pcm_volume()Max Kellermann2008-11-111-1/+1
| | | | Allow pcm_volume() to increase volume.
* pcm_volume: added constant PCM_VOLUME_1Max Kellermann2008-11-114-14/+27
| | | | | | | It may be desirable to change the range of integer volume levels (e.g. to 1024, which may utilize shifts instead of expensive integer divisions). Introduce the constant PCM_VOLUME_1 which describes the integer value for "100% volume". This is currently 1000.
* pcm_utils: added inline function pcm_float_to_volume()Max Kellermann2008-11-112-2/+13
|
* replay_gain: converted struct replay_gain_info elements to an arrayMax Kellermann2008-11-117-45/+47
| | | | | Having an array instead of individual variables allows the use of the replay_gain_mode enum as an array index.
* wavpack: added wavpack_tag_float()Max Kellermann2008-11-111-41/+25
| | | | | | The function simplifies wavpack_replaygain(), because it already contains the float parser, and it works with a fixed buffer instead of doing expensive heap allocations.
* wavpack: make the "key" argument to wavpack_tag() constMax Kellermann2008-11-111-9/+5
| | | | This allows us to remove the "static char[]" hack.
* ogg: ogg_getReplayGainInfo() returns replay_gain_info pointerMax Kellermann2008-11-111-13/+20
| | | | Some code simplification. Avoid pointers to pointers.
* replay_gain: converted replay_gain_mode to an enumMax Kellermann2008-11-112-5/+7
| | | | Prefer C enums over CPP macros.
* replay_gain: removed superfluous author name commentMax Kellermann2008-11-111-1/+0
| | | | The author's name is already mentioned in the copyright declaration.
* replay_gain: no CamelCaseMax Kellermann2008-11-1113-111/+119
| | | | Renamed functions and variables.