Commit Graph

4614 Commits

Author SHA1 Message Date
Anton Khirnov bff72634ca ffmpeg_plugin: convert metadata to generic format 2009-08-03 17:40:22 +02:00
Max Kellermann 6f060081be command: moved command_process_list() to client.c 2009-07-29 08:00:01 +02:00
Courtney Cavin 7f865f722c playlist: CamelCaseIsBad
Renamed all playlist functions to non-CamelCase.
2009-07-28 18:07:01 -04:00
Courtney Cavin 614a011845 input/lastfm: Ensure multiple identical xml entities are decoded.
Previously, if two identical entities appeared in one string, only the
first would get decoded. This fixes that bug.
2009-07-28 16:40:52 -04:00
Max Kellermann 0c66832b3b doc: removed deprecated mixer options from manpage
Removed documentation about the global options mixer_type,
mixer_device and mixer_control.
2009-07-28 17:22:55 +02:00
Max Kellermann f78366910e client: splitted client.c into several pieces
The soure file client.c has nearly 1000 lines, time for splitting it
into smaller pieces to improve readability.
2009-07-28 17:17:23 +02:00
Max Kellermann c426bbcf95 client: moved struct client to client_internal.h
Prepare splitting client.c into several sources.
2009-07-28 16:42:40 +02:00
Courtney Cavin 6d71094ce5 input/lastfm: use metadata
Added a patch to flush out the last.fm input plugin slightly. It
basically turns it into a wrapper for the appropriate plugin. Most
notably metadata is now extracted.
2009-07-28 16:41:50 +02:00
Max Kellermann 9322f04529 cmdline: obey $(sysconfdir) for default mpd.conf location
Instead of hard-coding the path "/etc/mpd.conf", use the configured
$(sysconfdir) path.  This can be set with:

 ./configure --sysconfdir=/etc

Note that this changes the default path to "/usr/local/etc/mpd.conf",
given the default prefix "/usr/local".  This is actually more correct
than the old default.
2009-07-28 16:17:18 +02:00
Max Kellermann 884201b919 client: moved some code to client_list_X()
Make the client list management a separate sub-library.
2009-07-23 19:20:30 +02:00
Max Kellermann a0afd0369f client: don't include socket headers
The client code uses portable GLib I/O functions and doesn't need the
OS specific socket headers.
2009-07-23 17:32:12 +02:00
Max Kellermann caf48ee973 player_thread: don't use precalculated size_to_time
Calculate the total play time with the audio_format object each time,
using audio_format_time_to_size().  The function
audioFormatSizeToTime() is not needed anymore, and will be removed
with this patch.
2009-07-23 12:27:05 +02:00
Max Kellermann 0749dbfadf player_thread: moved code to update_song_tag() 2009-07-23 12:26:26 +02:00
Max Kellermann 54889c72e3 pcm_convert: use GError for error handling
Don't abort the whole MPD process when the conversion fails.  This has
been a denial-of-service attack vector for years.
2009-07-23 12:01:03 +02:00
Max Kellermann cba126ceb8 pcm_resample_fallback: don't include glib.h
This library does not use GLib directly.
2009-07-22 19:54:57 +02:00
Max Kellermann c95663312a pcm_resample_fallback: removed G_GNUC_UNUSED attribute 2009-07-22 19:52:25 +02:00
Max Kellermann 00ee3de7b2 pcm_channels: num_channels is unsigned
You cannot have a negative number of channels, let's pass it as
uint8_t instead of int8_t.
2009-07-22 19:12:04 +02:00
Max Kellermann 172a1dbdb9 pcm_byteswap: converted NULL checks to assertions
It is illegal to pass a NULL buffer to pcm_byteswap_X().  The result
of this is that pcm_byteswap_X() never returns NULL.
2009-07-22 19:04:38 +02:00
Max Kellermann c5a662f405 pcm_convert: added pcm_convert_state.byteswap_buffer
Currently, byteswapping is performed on the format_buffer.  This can
go wrong when this buffer is used twice during one run.  Add a
separate buffer for swapping the byte order.
2009-07-22 15:56:56 +02:00
Max Kellermann 9277950441 filter/volume: check the flag audio_format.reverse_endian
The volume plugin does not work for reverse_endian samples.
2009-07-22 15:56:50 +02:00
Max Kellermann 44c97a8f6d audio_format: added API documentation 2009-07-22 15:56:48 +02:00
Max Kellermann 6a071efa27 audio_format: initialize reverse_endian in audio_format_init()
This line was missing in the reverse_endian patch, and led to
undefined values and crashes in that attribute.
2009-07-22 15:56:36 +02:00
Michal Nazarewicz bfed1c04cc daemon: daemonize_close_stdin() optimised.
Changed function to first close standard input (this may
fail but we don't care) and then try to open /dev/null (this
may fail but it shouldn't on Unix platforms plus we don't
know what to do in such case anyways).  Since standard input
has the "zeroth" descriptor number next "open" will use it.

Since there is no "/dev/null" on Windows (It's not even
a valid path!) the second step is skipped if WIN32 is
defined.

As a final touch, since the function consists of merely two
function calls it has been moved to header file and declared
static inline.

[mk: un-inline daemonize_close_stdin()]
2009-07-22 13:43:21 +02:00
Eugeny N Dzhurinsky bdb1965b50 cmdline: renamed options.stderr to options.log_stderr
On FreeBSD, "stderr" is a macro, and using this name for a struct
member breaks the build.

[mk: renamed _stderr to log_stderr]
2009-07-22 13:40:19 +02:00
Max Kellermann f4b39bc263 decoder/flac: fixed indentation of flac_comment_value() 2009-07-22 13:34:33 +02:00
Max Kellermann 47ed89bd4c decoder/flac: parse all replaygain tags
The FLAC replaygain parser used the "||" operator.  This made the code
stop after the first value which was found.
2009-07-22 13:31:48 +02:00
Max Kellermann cf1fd2b0da decoder/flac: return early from flac_find_float_comment()
When one metadata check fails, return quickly.  This removes 2 levels
of indent.
2009-07-22 13:31:46 +02:00
Max Kellermann 8e2d987996 decoder/flac: removed misplaced authorship comment
This belongs into "git annotate" or AUTHORS.
2009-07-22 13:31:43 +02:00
Max Kellermann 322ef3cb80 mad: skip ID3 frames when libid3tag is disabled
When libid3tag is disabled, the libmad decoder plugin is unable to
identify ID3 frames.  If the file starts with an (unidentified) ID3
frame, it assumes that the file is not a valid MP3 song.  This patch
solves this by adding minimal stubs for the ID3 functions.
2009-07-22 12:57:03 +02:00
Max Kellermann c9d43b4d71 Merge branch 'master' of git://git.infradead.org/users/dwmw2/mpd
Conflicts:

	Makefile.am
2009-07-19 18:18:32 +02:00
David Woodhouse 49ede85827 Support wrong-endian ALSA output 2009-07-19 17:15:35 +01:00
David Woodhouse 05693e2d5d Add reverse_endian field to struct audio_format and handle conversion 2009-07-19 17:15:21 +01:00
Max Kellermann c5ec035fb4 tag_ape: simplified the apeItems array
Make "enum tag_type" the array index, and convert apeItems to a sparse
array.
2009-07-19 18:04:42 +02:00
Max Kellermann 5e2f98fdad tag_ape: moved code to tag_ape_import_item()
Improve code readability.
2009-07-19 17:59:36 +02:00
Max Kellermann 7b92750622 tag_ape: converted apeItems and tagItems to global vars
Don't initialize those arrays each time tag_ape_load() is called.
2009-07-19 17:59:35 +02:00
David Woodhouse 37754559b8 Add audio_format_init() function
It makes no difference right now, but we're about to add an endianness
flag and will want to make sure it's correctly initialised every time.
2009-07-19 16:54:11 +01:00
Max Kellermann 0ce727d5d4 ape: added protection against large memory allocations
The function tag_ape_load() retrieves a 32 bit unsigned integer from
the input file, and passes it to g_malloc().  This is dangerous, and
may be used for a denial of service attack on MPD.
2009-07-19 17:38:46 +02:00
Max Kellermann e3ff0ab6d1 tag_ape: removed redundant length check
Extend the tagLen check after reading it.  Removed the second
(redundant) check after the subtraction.
2009-07-19 17:37:02 +02:00
Max Kellermann 09008cb0ec client: return "enum command_return" instead of "int"
Several functions work with the wrong return type, this patch fixes
them.
2009-07-19 15:53:48 +02:00
Max Kellermann b58aa1f5ee removed buffer2array.c 2009-07-19 15:15:41 +02:00
Max Kellermann 38e9205d4e command: use the tokenizer library 2009-07-19 15:15:36 +02:00
Max Kellermann 16ff44ad30 conf: use the tokenizer library 2009-07-19 15:11:37 +02:00
Max Kellermann 1745e68795 tokenizer: new library replacing buffer2array()
The new code is more robust and more flexible.  It provides detailed
error information in GError objects.
2009-07-19 15:11:36 +02:00
Michal Nazarewicz 809c96b53f daemon: Moved empty Windows version functions to header file
On Windows only daemonize_close_stdin() function does
something.  Other functions are either empty or generate an
error.  Those have been moved to header file and declared
static inline so compiler can remove the call all together.
2009-07-19 08:18:23 +02:00
Michal Nazarewicz 03e43356ce conf: replaced gcc "const" attribute with "pure"
The functions were not "const" (they examined values pointed
by arguments passed to them, quoting gcc's doc: "Note that
a function that has pointer arguments and examines the data
pointed to must _not_ be declared 'const'.") but rather
"pure" and still not all of them.

Note also, that even some of the functions declared "pure"
are not pure, however, due to reasons stated in source code
the attribute has been kept.
2009-07-19 08:18:08 +02:00
Michal Nazarewicz d718a8b59d daemon: added "group" configuration option
The "group" configuration option is similar to "user" as it
sets user set what group MPD shall run as.  With "user"
option, MPD changed GID to the GID of the user, however,
more control could be desired.

Moreover, the patch changes the way of checking whether no
setuid(2)/setgid(2) is required -- previously user names
were compered, now UID and GIDs are compered (ie. the one we
already have (getuid(2)/getgid(2)) with the one we want to
change to).
2009-07-19 08:17:55 +02:00
Max Kellermann a988b9b025 ape: check the tag size (fixes integer underflow)
The expression "tagLen - size > 0" may result in an integer underflow
and a buffer overflow, when "size" is larger than "tagLen".  "size" is
read from the input file, and must not be trusted.  This patch changes
the expression to "tagLen > size", which is a lot safer.
2009-07-18 22:45:56 +02:00
Max Kellermann c8c91d9aaa configure.ac: fix the --enable-alsa help string
--enable means "enable", not "disable".
2009-07-17 17:50:55 +02:00
Max Kellermann 4100035b19 Merged release 0.15.1 from branch 'v0.15.x' 2009-07-16 07:37:13 +02:00
Avuton Olrich 19f1bfdf40 Modify version string to post-release version 0.15.2~git 2009-07-15 13:36:41 -07:00