Laszlo Ashin
05f4629fa3
wavpack: redo using audio_format_frame_size()
...
Somehow we lost 600e1322
after renaming some variables in ed6f6046
.
2008-11-19 00:02:06 +01:00
Max Kellermann
362ca300d6
decoder: pass the correct buffer length to pcm_convert()
...
When a global audio format is configured (setting
"audio_output_format"), decoder_data() overwrote the "length"
parameter with the size of the output buffer (result of
pcm_convert_size()). Declare a separate variable for the output
buffer length.
2008-11-18 22:45:51 +01:00
Viliam Mateicka
33b5015469
ffmpeg: read tags from AVFormatContext
...
The ffmpeg library provides some of the song metadata in the
AVFormatContext struct. Pass it from there to MPD.
2008-11-18 20:03:00 +01:00
Viliam Mateicka
eac4ed2241
audiofile: fixed misplaced if
...
[mk: by definition, tag_new() cannot fail - removed check]
2008-11-18 19:54:42 +01:00
Max Kellermann
63272d6888
music_pipe: narrowed assertion on chunk index
...
The chunk index passed to successor() must be valid, i.e. it must be
smaller than num_chunks.
2008-11-18 19:54:39 +01:00
Max Kellermann
7591403566
input_stream: size==-1 means unknown size
...
Define the special value "-1" as "unknown size". Previously, there
was no indicator for streams with unknown size, which might confuse
some decoders.
2008-11-16 20:42:08 +01:00
Max Kellermann
8882f06200
ffmpeg: fixed AVSEEK_SIZE
...
With whence==AVSEEK_SIZE, the seek function should return the file
size, not the current offset. Check the return value of
input_stream_seek().
2008-11-16 20:25:31 +01:00
Max Kellermann
9c4e97a61b
aac: detect whether to pass "uint32_t*" to NeAACDecInit2()
...
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*".
2008-11-16 20:04:49 +01:00
Max Kellermann
acfba02310
decoder: check length==0 in decoder_read()
...
When the caller passes length==0, decoder_read() entered an endless
loop. Check that condition before entering the "while" loop.
2008-11-15 19:27:30 +01:00
Laszlo Ashin
c368a2f91c
aac: fix compiler warnings on amd64
2008-11-15 11:54:22 +01:00
Laszlo Ashin
00da7db1e3
aac: don't try to free static buffer
...
In 432da18e
a dynamic buffer was replaced by a static one but some
frees were accidently left there which caused some segfaults.
2008-11-15 11:50:25 +01:00
Avuton Olrich
0efd80d2e5
MPD version 0.14~alpha3
2008-11-14 10:29:06 -08:00
Max Kellermann
4a1ad61e8e
log: check the log threshold in log_func()
...
The threshold was only checked in the deprecated logging functions
(ERROR(), WARNING(), ...). Add the check to the GLib logging handler.
2008-11-14 18:27:11 +01:00
Max Kellermann
7720a1195a
volume: eliminate alloca() usage
...
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-14 18:15:33 +01:00
Max Kellermann
19131f1eda
volume: moved code to oss_mixer_find()
2008-11-14 18:05:13 +01:00
Max Kellermann
eb199ca207
player: don't queue song when there are 2 songs in the pipe
...
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-14 17:55:51 +01:00
Max Kellermann
418dac6f94
player: wake up decoder before waiting for xfade chunks
...
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-14 17:55:45 +01:00
László Áshin
440b1ea3ea
wavpack: be more robust if the underlying stream is not seekable
...
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-14 15:23:18 +01:00
László Áshin
c495c6f5af
wavpack: tolerate less decoded data than requested
...
Wavpack plugin doesn't stop decoding if a block couldn't be fully
decoded, rather it tries to go on.
2008-11-14 15:23:13 +01:00
László Áshin
ed6f60460d
wavpack: renamed variables and modified coding style slightly
2008-11-14 15:21:44 +01:00
Max Kellermann
7b7340f703
mp3: fix SEEK command check after mp3_synth_and_send()
...
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-13 14:43:19 +01:00
Max Kellermann
2dacd16b5b
decoder: additional dc.command checks in decoder_data()
...
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-13 14:43:19 +01:00
Avuton Olrich
3eb9b3218d
MPD version 0.14~alpha2
2008-11-13 14:43:10 +01:00
Max Kellermann
2860b1b60f
decoder: wait for the player only if the music pipe is full
...
Prevent superfluous wakeups and a deadlock condition.
2008-11-13 02:54:56 +01:00
Max Kellermann
1a3945b563
decoder: check dc.command at the beginning of decoder_data()
...
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-13 02:42:40 +01:00
Max Kellermann
709640422c
player: chop the tail of the music pipe after CANCEL
...
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-13 02:09:33 +01:00
Max Kellermann
66ce1495f0
music_pipe: continuously check the sample format of all chunks
...
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-13 02:06:58 +01:00
Max Kellermann
998d9a8225
decoder: ignore SEEK commands during initialization
...
When the decoder receives a SEEK during initialization, it should
ignore that for now. The old code made most decoders abort.
2008-11-13 02:06:55 +01:00
Max Kellermann
1178e485cb
music_pipe: check for partial frames in appended chunk
...
Added an additional assertion which checks partial frames in the
existing tail chunk.
2008-11-13 02:06:52 +01:00
Max Kellermann
df09075afc
player: assert that there was no previous "next song chunk"
...
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-13 01:57:15 +01:00
Max Kellermann
ae9bb92952
playlist: call clearPlayerQueue() only if song is queued II
...
This patch extends commit 35a16b99
, and amends several 2 missing
checks. It simplifies 2 more checks by merging "if" conditions.
2008-11-12 21:55:13 +01:00
Max Kellermann
93f488f034
wavpack: remove commented debug messages
2008-11-12 21:25:08 +01:00
Max Kellermann
600e132280
wavpack: calculate outsamplesize with audio_format_frame_size()
2008-11-12 21:25:02 +01:00
Max Kellermann
ef80464c0c
ogg: revert "use ogg_fopen() instead of ogg_open()"
...
Unfortunately, ov_fopen() is not supported by libvorbis versions older
than 1.2.
2008-11-12 08:38:04 +01:00
Max Kellermann
b67a8e4d6e
aac: shift the input buffer before the full check
...
When the buffer was full, but everything was already consumed,
fillAacBuffer() would not attempt to flush and refill it.
2008-11-12 08:32:21 +01:00
Max Kellermann
432da18e44
aac: make the input buffer static
...
Allocate the input buffer within the AacBuffer struct.
2008-11-12 08:29:40 +01:00
Max Kellermann
487e05c67d
aac: reject SEEK commands
...
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-12 08:25:09 +01:00
Max Kellermann
a9723e661a
aac: get decoder command from decoder_data()
...
Removed a superfluous decoder_get_command() call.
2008-11-12 08:25:06 +01:00
Max Kellermann
35a4ca2421
aac: convert audio_format to temporary variable
...
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-12 08:21:00 +01:00
Max Kellermann
39fa60769c
aac: removed method file_decode()
...
aac_stream_decode() was basically copy+pasted from aac_decode().
Since stream_decode() can also decode files, eliminate aac_decode().
2008-11-12 08:17:50 +01:00
Max Kellermann
e19b53f814
aac: check the buffer length in the ADIF parser
...
Check whether enough data has been read yet.
2008-11-12 08:16:54 +01:00
Max Kellermann
b30ec73099
aac: use unsigned integers and size_t where appropriate
2008-11-12 08:16:38 +01:00
Max Kellermann
9806355d4c
aac: check if the stream is seekable before length check
...
If the stream is not seekable, don't try to decode all frames to find
out the total song time.
2008-11-12 07:46:01 +01:00
Max Kellermann
f6765c4d8b
aac: removed attribute "atEof"
...
Use input_stream_eof() instead.
2008-11-12 07:41:54 +01:00
Max Kellermann
eff21067f0
mpc: assume the result fo of mpc_decoder_decode() is unsigned
...
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-12 07:14:18 +01:00
Max Kellermann
0a6f4048d0
mpc: don't assume the stream is stereo
...
Don't hard-code the factor "2".
2008-11-12 07:07:40 +01:00
Max Kellermann
8d1ffb1684
mpc: get decoder command from decoder_data()
...
Removed 3 superfluous decoder_get_command() invocations.
2008-11-12 07:07:12 +01:00
Max Kellermann
731e99c26e
mpc: moved code to mpc_to_mpd_buffer()
...
mpc_to_mpd_buffer() converts a whole chunk at a time. This eliminates
3 local variables in mpc_decode().
2008-11-12 07:06:47 +01:00
Max Kellermann
975d5cd77e
mpc: make the buffer large enough for one mpc frame
...
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-12 07:03:44 +01:00
Max Kellermann
865757835e
mpc: use GLib instead of utils.h/log.h
...
Don't use deprecated MPD libraries.
2008-11-12 07:02:29 +01:00