Commit Graph

4452 Commits

Author SHA1 Message Date
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 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 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 4100035b19 Merged release 0.15.1 from branch 'v0.15.x' 2009-07-16 07:37:13 +02:00
Avuton Olrich d7bad6ae02 mpd version 0.15.1 2009-07-15 13:36:41 -07:00
Max Kellermann 9bef46c0da mapper: use g_file_test() instead of stat()
The GLib functions are more portable.
2009-07-15 18:58:24 +02:00
Max Kellermann c134adbcbf mapper: pass music and playlist directory to mapper_init()
Added another glue function in main().
2009-07-15 18:58:19 +02:00
Max Kellermann 7bc8c7518b main: moved complex initialization code to glue functions
The glue_*() functions act as a glue between MPD's main() function and
its libraries.  They handle disabled features, and pass validated
configuration options.
2009-07-15 18:58:12 +02:00
Max Kellermann 739984f920 main: renamed openDB() to glue_db_init_and_load()
No CamelCase.
2009-07-15 18:58:10 +02:00
Max Kellermann 7261739526 cmdline: renamed option "--stdout" to "--stderr"
Since version 0.14, MPD has been logging to standard error instead of
standard output.  The option name should reflect that.  The old option
continues to work, we will remove it in a future MPD release.
2009-07-15 18:27:32 +02:00
Max Kellermann 62f9df98b4 cmdline: no CamelCase
Renamed type, variables and functions.
2009-07-15 18:22:49 +02:00
Max Kellermann c76f71e8d6 conf: added the gcc "const" attribute to some functions
Add the "const" attribute to functions when their return value only
depends on parameters.  This allows gcc to eliminate some function
calls.
2009-07-15 17:12:48 +02:00
Max Kellermann f0157f6fa1 Makefile.am: disable test/run_encoder without plugins
If the encoder plugin API is disabled at compile time, don't compile
test/run_encoder.c.
2009-07-15 16:59:06 +02:00
Max Kellermann f7cc5b2efd state_file: don't rewind the stream while reading the state file
Parse the state file line by line, let each subsystem probe a line.
Only the playlist_state code gets the FILE pointer to read the
following lines.
2009-07-15 16:57:37 +02:00
Max Kellermann df7d7732c6 state_file: simplified state_file_finish()
Return early from the destructor function when there is no configured
state file.  Don't check the timer, don't call g_free(NULL).
2009-07-15 14:32:29 +02:00
Max Kellermann 889b1c1eae state_file: fixed debug messages
Print "Loading" instead of "Saving" in state_file_read().  Added debug
message to state_file_write().
2009-07-15 14:29:30 +02:00