aboutsummaryrefslogtreecommitdiffstats
path: root/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-11-14log: check the log threshold in log_func()Max Kellermann1-0/+3
The threshold was only checked in the deprecated logging functions (ERROR(), WARNING(), ...). Add the check to the GLib logging handler.
2008-11-14volume: eliminate alloca() usageMax Kellermann1-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.
2008-11-14volume: moved code to oss_mixer_find()Max Kellermann1-14/+23
2008-11-14player: don't queue song when there are 2 songs in the pipeMax Kellermann1-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.
2008-11-14player: wake up decoder before waiting for xfade chunksMax Kellermann1-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().
2008-11-14wavpack: be more robust if the underlying stream is not seekableLászló Áshin1-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.
2008-11-14wavpack: tolerate less decoded data than requestedLászló Áshin1-1/+1
Wavpack plugin doesn't stop decoding if a block couldn't be fully decoded, rather it tries to go on.
2008-11-14wavpack: renamed variables and modified coding style slightlyLászló Áshin1-80/+113
2008-11-13mp3: fix SEEK command check after mp3_synth_and_send()Max Kellermann1-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.
2008-11-13decoder: additional dc.command checks in decoder_data()Max Kellermann1-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().
2008-11-13decoder: wait for the player only if the music pipe is fullMax Kellermann1-4/+5
Prevent superfluous wakeups and a deadlock condition.
2008-11-13decoder: check dc.command at the beginning of decoder_data()Max Kellermann1-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().
2008-11-13player: chop the tail of the music pipe after CANCELMax Kellermann3-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.
2008-11-13music_pipe: continuously check the sample format of all chunksMax Kellermann3-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.
2008-11-13decoder: ignore SEEK commands during initializationMax Kellermann1-1/+4
When the decoder receives a SEEK during initialization, it should ignore that for now. The old code made most decoders abort.
2008-11-13music_pipe: check for partial frames in appended chunkMax Kellermann1-0/+2
Added an additional assertion which checks partial frames in the existing tail chunk.
2008-11-13player: assert that there was no previous "next song chunk"Max Kellermann1-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.
2008-11-12playlist: call clearPlayerQueue() only if song is queued IIMax Kellermann1-14/+10
This patch extends commit 35a16b99, and amends several 2 missing checks. It simplifies 2 more checks by merging "if" conditions.
2008-11-12wavpack: remove commented debug messagesMax Kellermann1-6/+1
2008-11-12wavpack: calculate outsamplesize with audio_format_frame_size()Max Kellermann1-5/+1
2008-11-12ogg: revert "use ogg_fopen() instead of ogg_open()"Max Kellermann1-6/+9
Unfortunately, ov_fopen() is not supported by libvorbis versions older than 1.2.
2008-11-12aac: shift the input buffer before the full checkMax Kellermann1-4/+5
When the buffer was full, but everything was already consumed, fillAacBuffer() would not attempt to flush and refill it.
2008-11-12aac: make the input buffer staticMax Kellermann1-9/+4
Allocate the input buffer within the AacBuffer struct.
2008-11-12aac: reject SEEK commandsMax Kellermann1-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.
2008-11-12aac: get decoder command from decoder_data()Max Kellermann1-4/+5
Removed a superfluous decoder_get_command() call.
2008-11-12aac: convert audio_format to temporary variableMax Kellermann1-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.
2008-11-12aac: removed method file_decode()Max Kellermann1-124/+1
aac_stream_decode() was basically copy+pasted from aac_decode(). Since stream_decode() can also decode files, eliminate aac_decode().
2008-11-12aac: check the buffer length in the ADIF parserMax Kellermann1-0/+6
Check whether enough data has been read yet.
2008-11-12aac: use unsigned integers and size_t where appropriateMax Kellermann1-5/+6
2008-11-12aac: check if the stream is seekable before length checkMax Kellermann1-1/+2
If the stream is not seekable, don't try to decode all frames to find out the total song time.
2008-11-12aac: removed attribute "atEof"Max Kellermann1-14/+7
Use input_stream_eof() instead.
2008-11-12mpc: assume the result fo of mpc_decoder_decode() is unsignedMax Kellermann1-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.
2008-11-12mpc: don't assume the stream is stereoMax Kellermann1-2/+1
Don't hard-code the factor "2".
2008-11-12mpc: get decoder command from decoder_data()Max Kellermann1-12/+9
Removed 3 superfluous decoder_get_command() invocations.
2008-11-12mpc: moved code to mpc_to_mpd_buffer()Max Kellermann1-14/+12
mpc_to_mpd_buffer() converts a whole chunk at a time. This eliminates 3 local variables in mpc_decode().
2008-11-12mpc: make the buffer large enough for one mpc frameMax Kellermann1-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.
2008-11-12mpc: use GLib instead of utils.h/log.hMax Kellermann1-9/+6
Don't use deprecated MPD libraries.
2008-11-12mpc: declare buffer as int32_t[]Max Kellermann1-4/+4
The buffer is always casted to int32_t* anyway; declare it as int32_t array, and remove the cast.
2008-11-11mpc: eliminated the local variable "eof"Max Kellermann1-8/+3
Since each "eof=true" is followed by "break", the variable is superfluous.
2008-11-11ogg: removed stray "}"Max Kellermann1-1/+0
Due to an unnoticed merge error, there was a superfluous "}". Remove it.
2008-11-11ogg: use ogg_fopen() instead of ogg_open()Max Kellermann1-8/+6
Move the reponsibility for freeing the file handle to libvorbis.
2008-11-11ogg: use GLib instead of utils.h/log.hMax Kellermann1-6/+8
2008-11-11decoder: fixed typo in assertionMax Kellermann1-1/+1
decoder_file_decode() should check for plugin->file_decode, not plugin->stream_decode().
2008-11-11ogg: get decoder command from decoder_data()Max Kellermann1-9/+8
Eliminate two decoder_get_command() invocations from the main loop.
2008-11-11ogg: flush buffer after every ov_read() callMax Kellermann1-25/+10
Don't let the buffer grow until it is full, flush it whenever there is data available.
2008-11-11mp3: support stream tagsMax Kellermann1-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.
2008-11-11mp3: eliminated duplicate command checkMax Kellermann1-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.
2008-11-11player: fix race condition during tag updateMax Kellermann1-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.
2008-11-11playlist: track song metadata changesMax Kellermann2-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.
2008-11-11oggflac: removed the obsolete try_decode() methodMax Kellermann1-6/+3