aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* music_pipe: narrowed assertion on chunk indexMax Kellermann2008-11-181-1/+1
| | | | | The chunk index passed to successor() must be valid, i.e. it must be smaller than num_chunks.
* input_stream: size==-1 means unknown sizeMax Kellermann2008-11-166-2/+15
| | | | | | 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*".
* decoder: check length==0 in decoder_read()Max Kellermann2008-11-152-0/+7
| | | | | When the caller passes length==0, decoder_read() entered an endless loop. Check that condition before entering the "while" loop.
* 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.
* 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().
* 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().