aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* log: check the log threshold in log_func()Max Kellermann2008-11-141-0/+3
| | | | | The threshold was only checked in the deprecated logging functions (ERROR(), WARNING(), ...). Add the check to the GLib logging handler.
* volume: eliminate alloca() usageMax Kellermann2008-11-141-11/+4
| | | | | | alloca() is not a portable function. Don't use it. Using strncasecmp() is much more efficient anyway, because no memory needs to be allocated and copied.
* volume: moved code to oss_mixer_find()Max Kellermann2008-11-141-14/+23
|
* player: don't queue song when there are 2 songs in the pipeMax Kellermann2008-11-141-0/+5
| | | | | | | | | Don't send a "next song" request to the main thread when the current song hasn't started playing yet, i.e. there are already two different songs in the music pipe. This would erase information about the song boundary within the music pipe, and thus triggered an assertion failure. The bug could occur when playing very short songs which fit into the pipe as a whole.
* player: wake up decoder before waiting for xfade chunksMax Kellermann2008-11-141-0/+1
| | | | | | Fix a deadlock: when the decoder waited for buffer space, the player could enter a deadlock situation because it waits for more chunks for crossfading chunks. Signal the decoder before entering notify_wait().
* 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.
* decoder: additional dc.command checks in decoder_data()Max Kellermann2008-11-131-0/+3
| | | | | When a command is sent while the decoder waits for a free chunk in the music pipe, it was not returned by decoder_data().
* MPD version 0.14~alpha2release-0.14_alpha2Avuton Olrich2008-11-131-1/+1
|
* decoder: wait for the player only if the music pipe is fullMax Kellermann2008-11-131-4/+5
| | | | Prevent superfluous wakeups and a deadlock condition.
* decoder: check dc.command at the beginning of decoder_data()Max Kellermann2008-11-131-0/+4
| | | | | | Seeking was somewhat broken in some decoder plugins because they sent empty chunks, and never got a command. Check the decoder command before doing anything else in decoder_data().
* player: chop the tail of the music pipe after CANCELMax Kellermann2008-11-133-0/+19
| | | | | | When a CANCEL command is received, the player should drop all chunks of the next song. Added new funciton music_pipe_chop() which is used for that.
* music_pipe: continuously check the sample format of all chunksMax Kellermann2008-11-133-0/+29
| | | | | Provide a debug function which asserts on the sample format of all chunks. Call this function in each iteration of the player main loop.
* 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.