Commit Graph

3127 Commits

Author SHA1 Message Date
Laszlo Ashin
a493aafe02 wavpack: use assert_static() 2008-11-22 14:28:11 +01:00
Laszlo Ashin
457a6f4bee utils: introduce assert_static()
assert_static() will help us to find false asserts in compile time. Of
course it only works in case of expressions which can be evaluated
compile time. It cannot be used in global scope.
2008-11-22 14:28:11 +01:00
Marc Pavot
0bad84066b command: allow clients to subscribe to specific idle events
The client may provide the names of idle events as arguments to the
"idle" command to inform MPD that it is only interested in these
events.
2008-11-22 13:26:21 +01:00
Max Kellermann
976d5045c6 decoder: check audio_format_valid() in all decoders
Refuse to play audio formats which are not supported by MPD.
2008-11-21 20:27:30 +01:00
Max Kellermann
be9e60d55e audio_format: added audio_format_valid() 2008-11-21 20:27:05 +01:00
Max Kellermann
774417f12f decoder: ignore decoder_data() calls with length==0
Pushing buffers with a zero length into the MPD core causes failures;
don't let them pass beyond the decoder plugi API.
2008-11-21 20:26:57 +01:00
Max Kellermann
63c3ebee46 flac, oggflac: use GLib instead of utils.h/log.h 2008-11-21 20:15:50 +01:00
Max Kellermann
f15fc4e99a ffmpeg: use GLib instead of log.h 2008-11-21 20:13:41 +01:00
Max Kellermann
4a3a621caf audiofile: use GLib instead of log.h 2008-11-21 20:13:36 +01:00
Max Kellermann
7a2fe930b8 aac: use GLib instead of utils.h/log.h
Removed the superfluous my_usleep() call.
2008-11-21 20:13:26 +01:00
Max Kellermann
0243e1e26d log: print the log_domain 2008-11-21 20:13:00 +01:00
Max Kellermann
1c0c583216 state_file: save state_file every 5 minutes
When MPD quits in a non-clean way, the state file isn't written, and
on the next start, MPD time warps to the previous clean shutdown.
Save the state file every 5 minutes; this will probably be
configurable at a later time.

Note that we don't set a wakeup timer for that: when there is no MPD
traffic, MPD won't wake up to save the state file.  This minor bug is
tolerated, because usually there is no change in MPD's state when the
main thread is idle.
2008-11-21 18:36:33 +01:00
Max Kellermann
695d8051d2 input_curl: try to seek by fast-forwarding the buffer
If the caller attempts to seek only a few bytes forward, chances are
good that the offset is already in the buffer.  In this case, simply
fast-forward the buffer.
2008-11-21 17:10:20 +01:00
Max Kellermann
46df0fd7dc input_curl: moved code to consume_buffer()
Added some assertions.
2008-11-21 16:57:55 +01:00
Max Kellermann
7779e4133a input_curl: don't do temporary calculations with input_stream.offset
If someone calls seek() with an invalid (negative) offset, the curl
implementation of that method returned false, but left this invalid
offset in input_stream.offset.  Move the calculation to a temporary
variable.
2008-11-21 16:56:10 +01:00
Monika Brinkert
a165ee25e8 doc: merged protocol documentation from the wiki
Over the years, a lot of commands have been added to MPD which were
documented only in the wiki
(http://mpd.wikia.com/wiki/Protocol_Reference).  Merge all missing
commands from there.
2008-11-20 22:20:01 +01:00
Monika Brinkert
63a885026a doc: rephrase descriptions
Correct lots of grammar and spelling errors.  Unify some phrases.
2008-11-20 22:20:01 +01:00
Monika Brinkert
08c7160eee doc: improved XML decorations
Wrapped keywords in DocBook tags where appropriate.
2008-11-20 22:20:01 +01:00
Viliam Mateicka
dbcf73721e AUTHORS: added Viliam Mateicka 2008-11-20 21:31:13 +01:00
Max Kellermann
61ba50a9bc decoder: ignore the SEEK command during startup
While waiting for the input stream to become ready, ignore all
commands except STOP.  This fixes seeking errors with (remote) songs
which the decoder has already finished.
2008-11-20 21:08:16 +01:00
Max Kellermann
927bf45f84 ogg: moved the "errorStr" variable into the error handler 2008-11-20 20:11:00 +01:00
Laszlo Ashin
65a8822a0b aac: get rid of gcc warnings 2008-11-20 19:20:25 +01:00
Konstantin Sobolev
7ac3abf499 update: pass UTF-8 path to skip_symlink()
skip_symlinks() expects an UTF-8 encoded file name, but
updateDirectory() passed ent->d_name (in file system encoding) to it.
Convert it to UTF-8 first.
2008-11-20 18:22:07 +01:00
Konstantin Sobolev
23b097593e mapper: use the utf8_to_fs_charset() result
In map_directory_child_fs(), the result of utf8_to_fs_charset() was
never used, because it passed the unmodified "name" parameter to
pfx_dir().
2008-11-20 18:10:18 +01:00
Konstantin Sobolev
ddab531b4a path: fix g_convert() argument order
g_convert() wants the destination character set first.  This was mixed
up.
2008-11-20 17:48:11 +01:00
Max Kellermann
1f50146e29 ogg: check the ov_read() return value before the vorbis_info evaluation
The ov_info() return value may be corrupt when ov_read() did not
return a positive value.  First check for success, then check
ov_info().
2008-11-20 12:45:17 +01:00
Max Kellermann
a8f69429b0 input_curl: don't fail when seek to EOF is requested
HTTP servers respond with "416 Requested Range Not Satisfiable" when a
client attempts to seek to the end of the file.  Catch this special
case in input_curl_seek().  This fixes a glitch in the ogg vorbis
decoder plugin.
2008-11-20 12:45:17 +01:00
Max Kellermann
a0dd5b7f2f curl: don't check running_handles for EOF
Since we are using curl_multi_info_read() / CURLMSG_DONE for detecting
end-of-response, we can remove all running_handles==0 checks.  For
some reason, that has never worked correctly.
2008-11-20 12:42:42 +01:00
Max Kellermann
f61904db33 input_curl: always set eof=true on CURLMSG_DONE
curl_multi_info_read() is the authoritative source of the
"end-of-response" information.  Always set c->eof when a CURLMSG_DONE
message is received, and check the result (success/failure) after
that.
2008-11-20 12:41:59 +01:00
Max Kellermann
90bfe65e54 doc: process protocol.xml with xmlto
Generate and install protocol.html if xmlto is available.
2008-11-20 08:59:55 +01:00
Max Kellermann
a3d0e571cc doc: fix "Repeat" typo in protocol.xml
The attribute value must be lower case: <arg rep="repeat">
2008-11-20 08:59:54 +01:00
Max Kellermann
a3fd74d0dc doc: converted doc/COMMANDS to DocBook
The goal is to have one structured document which is the authoritative
protocol specification.  The documentation which currently resides in
the wiki will be merged.
2008-11-19 21:16:19 +01:00
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