Max Kellermann
92db09fdf8
listen: return GError on "unix path too long"
...
When the unix domain socket path is too long, don't abort with
g_error().
2009-03-01 13:35:44 +01:00
Max Kellermann
f2664e329f
listen: removed unused macro BINDERROR()
2009-03-01 13:34:44 +01:00
Max Kellermann
d399d4b63b
output_init: removed getBlockParam()
...
Use config_get_block_string() and manual GError handling instead.
2009-03-01 13:32:42 +01:00
Max Kellermann
f298fcf3a6
output_init: return GError on error
...
Do error handling with GError instead of aborting with g_error().
2009-03-01 13:31:56 +01:00
Max Kellermann
cb942eeb45
output_init: moved code to audio_output_detect()
2009-03-01 13:31:32 +01:00
Max Kellermann
af66f666c6
audiofile: added 24 bit support
...
Don't hard code the "bits" parameter to 16. Try to use the input's
sample format, if possible.
2009-03-01 10:53:46 +01:00
Max Kellermann
614fe8b341
output: removed duplicate debug messages from plugins
...
The MPD core logs the audio format of all audio outputs. Remove the
duplicate message from the plugins.
2009-03-01 10:39:42 +01:00
Max Kellermann
e1b79479a5
output_thread: log audio format in a debug message
...
To aid debugging, print the audio format of the output plugin in a
debug message, and print information about PCM conversion.
2009-03-01 10:37:26 +01:00
Max Kellermann
a81a84eaa4
decoder_api: log audio format in a debug message
...
To aid debugging, print the audio format of the decoder plugin in a
debug message, and print information about PCM conversion.
2009-03-01 10:31:47 +01:00
Max Kellermann
c0e61687b6
listen: fix windows specific code
...
During the listen_add_host() API transition, the windows code wasn't
tested, and several removed arguments are still in use there.
2009-03-01 01:49:49 +01:00
Max Kellermann
8c3df4cc83
socket_util: include ws2tcpip.h for getnameinfo()
...
Windows doesn't have the standard headers sys/socket.h and netdb.h.
2009-03-01 01:35:54 +01:00
Max Kellermann
eb64f6542f
daemon: disable daemonize_detach() on WIN32
2009-03-01 01:35:53 +01:00
Max Kellermann
80571d1b5a
tag: convert ignore_tag_items to a bool array
2009-03-01 00:58:32 +01:00
Max Kellermann
6153c86bc3
tag: added API documentation
2009-03-01 00:55:20 +01:00
Max Kellermann
b49518c636
tag: no CamelCase
...
Renamed functions and variables.
2009-03-01 00:52:02 +01:00
Max Kellermann
ae87abae59
use GLIB_CHECK_VERSION()
...
Use GLIB_CHECK_VERSION() instead of manually checking
GLIB_MAJOR_VERSION, ...
2009-03-01 00:37:22 +01:00
Max Kellermann
82b081a6db
volume: throttle access to hardware mixers
...
On some hardware, reading the mixer value from hardware is an
expensive operation, and MPD has to do it for every client. Throttle
access to the hardware, cache the result for one second.
2009-02-28 21:12:15 +01:00
Max Kellermann
ec4fd9fd88
output: use GTimer instead of time_t for reopen after failure
...
time() is not a monotonic timer, and MPD might get confused by clock
skews. clock_gettime() provides a monotonic clock, but is not
portable to non-POSIX systems (i.e. Windows). This patch uses GLib's
GTimer API, which aims to be portable.
2009-02-28 20:43:23 +01:00
Max Kellermann
a5c09c91c4
output: added option to disable audio outputs by default
...
The option "enabled" is on by default. If you specify "enabled no" in
an audio_output section, then this device is disabled by default.
2009-02-28 19:40:39 +01:00
Max Kellermann
d29db0111c
audiofile: removed duplicate decoder_get_command() calls
...
decoder_data() returns a decoder_command, no need to call
decoder_get_command() twice after decoder_command().
2009-02-28 19:28:38 +01:00
Max Kellermann
0813092c63
audiofile: refuse to play non-seekable files
...
If an input_stream is not seekable, libaudiofile fails to play at all:
Audio File Library: unrecognized audio file format [error 0]
Since we know in advance whether the input_stream is seekable, just
refuse to play on a non-seekable stream.
2009-02-28 19:24:40 +01:00
Max Kellermann
44b55bff89
audiofile: no CamelCase
...
Renamed several variables and a function.
2009-02-28 19:09:54 +01:00
Max Kellermann
4a2b315ab6
tag: moved APE code to tag_ape.c
2009-02-28 16:44:41 +01:00
Michal Nazarewicz
cabbf7ab4a
pipe: new audio output plugin which runs a command
...
[mk: adapted to new output plugin API]
2009-02-28 16:11:59 +01:00
Max Kellermann
5ea8a0df3f
decoder_list: print decoder list with suffixes
...
Print the list of suffixes supported by each decoder, instead of
prining a list of all suffixes of all decoders with duplicates.
2009-02-28 15:29:51 +01:00
Max Kellermann
1bb0124b77
listen: allocate sockaddr_storage struct for accept()
...
The generic sockaddr struct is too small for some addresses. For
accept(), we have to allocate a sockaddr_storage struct on the stack,
which is large enough for all addresses.
2009-02-28 15:20:35 +01:00
Max Kellermann
5c10d2ded7
client: use sockaddr_to_string()
...
Removed the sockaddr_to_tmp_string() hack, use
the new function sockaddr_to_string() instead.
2009-02-28 15:20:35 +01:00
Max Kellermann
e085deb944
socket_util: unpack V4MAPPED addresses
...
Unpack IPv4 addresses which are packed inside an IPv6 address,
i.e. return "127.0.0.1" rather than "::ffff:127.0.0.1".
2009-02-28 15:20:33 +01:00
Max Kellermann
b55d9fcdb8
socket_util: added function sockaddr_to_string()
...
Create the socket_util.c library, the first function is
sockaddr_to_string(): it converts a sockaddr struct to a string
containing the IP address in a human-readable form.
2009-02-28 15:12:24 +01:00
Max Kellermann
0fcb7dc65c
update: use G_FILE_TEST_IS_REGULAR for archive files
...
When checking whether database entries have been deleted, don't check
if an archive file is a directory (G_FILE_TEST_IS_DIR), use
G_FILE_TEST_IS_REGULAR for this case instead. To determine if a
"struct directory" is an archive, check for device==DEVICE_INARCHIVE.
This is always false after loading the database, so this patch is not
complete yet.
2009-02-28 14:02:08 +01:00
Max Kellermann
83b1b0ff69
update: don't update unchanged archive
...
When the mtime of an archive time hasn't changed, don't update it
again.
2009-02-28 14:02:03 +01:00
Max Kellermann
2aebbf8460
directory: added "mtime" property
...
Remember the modification time of each directory. This is important
for archives (which are virtual directories right now), but may also
be useful for an automatic update mechanism.
2009-02-28 14:02:00 +01:00
Max Kellermann
3d6e6416e5
update: moved code to update_archive_file()
...
Simplify the rather large function update_regular_file().
2009-02-28 14:01:33 +01:00
Max Kellermann
7473fa0f4e
directory: moved DIRECTORY_* string constants
...
Moved some of them to to directory_save.c, and others to database.c.
2009-02-27 19:30:16 +01:00
Max Kellermann
eae0287466
song_print: hide HTTP password in playlist
...
Added the uri_remove_auth() library function which strips username
and password from a HTTP URI, and use it in song_print_url(). This
allows you to add HTTP URIs to the playlist including secret username
and password, without disclosing it to all MPD clients.
2009-02-27 19:20:11 +01:00
Max Kellermann
9dd00dfab7
client: removed duplicate "client" string from log
...
Since we introduced a GLib logging domain, the "client" string appears
twice in the log lines:
client: client 0: command returned 0
Removed the second one, now it looks like this:
client: [0] command returned 0
Still not quite good, but better than before.
2009-02-27 19:03:13 +01:00
Max Kellermann
53271e8ae7
update: print error when opendir() fails
...
MPD used to be silent when it could stat() a directory, but could not
opendir() it to read its contents. This caused a lot of support
headache with users who have wrong file permissions. Add another
warning message.
2009-02-27 09:05:58 +01:00
Max Kellermann
497c0b1c18
tag: don't accept invalid UTF-8 sequences
...
Overwrite invalid UTF-8 sequences with question marks.
2009-02-27 09:02:32 +01:00
Max Kellermann
c1ab2d06aa
tag: make tag.num_items unsigned
...
There's no point in declaring num_items as a uint8_t, it doesn't save
any space, due to padding. This allows us to lift the articial "255
items" limitation.
2009-02-27 09:02:13 +01:00
Max Kellermann
75c2029b1c
tag: no CamelCase
...
Renamed numOfItems to num_items.
2009-02-27 09:01:55 +01:00
Max Kellermann
5b07cbf0b4
tag: make tag_equal() return bool
2009-02-27 08:06:59 +01:00
Max Kellermann
bcdf947afc
player_thread: removed meaningless warning on output failure
...
The warning message "problems opening audio device while playing ..."
does not help at all, and should be removed. At this point, the real
error message has already been logged by the output thread.
2009-02-26 22:21:35 +01:00
Max Kellermann
9e61c0503e
output_all: print a warning when all outputs are disabled
...
When all outputs are disabled, MPD printed only a meaningless message
"problems opening audio device", although it didn't attempt to open a
device.
2009-02-26 22:21:32 +01:00
Max Kellermann
58c201ce14
output_all: removed "audio_outputs!=NULL" check
...
After initialization, audio_outputs is always non-NULL. Don't check
that.
2009-02-26 22:14:54 +01:00
Max Kellermann
dfea6b7cdd
mvp: fixed default device detection
...
The check "open()!=0" is wrong, you have to write "open()>=0", because
-1 means error, and 0 is a valid file handle.
2009-02-26 22:10:58 +01:00
Max Kellermann
ec926539a3
output_plugin: report errors with GError
...
Use GLib's GError library for reporting output device failures.
Note that some init() methods don't clean up properly after a failure,
but that's ok for now, because the MPD core will abort anyway.
2009-02-26 22:04:59 +01:00
Max Kellermann
353ae5e558
osx: use OSStatus and GetMacOSStatusCommentString()
...
The return type of most OS X functions is OSStatus, not int. We can
get a nice error message from GetMacOSStatusCommentString(), log it.
2009-02-26 22:01:42 +01:00
Max Kellermann
9dc966041d
osx: start the audio device in the open() method
...
Don't call AudioOutputUnitStart() in the play() method, do it after
the device has been opened. We can eliminate the "started" property
now, because the device is always started when it's open.
2009-02-26 21:40:22 +01:00
Max Kellermann
fb5ca6aa29
osx: removed commented code
...
We don't need to keep commented code forever. If we want that
test_default_device() implementation back one day, we'll pick it from
the git history.
2009-02-26 21:33:13 +01:00
Max Kellermann
985ca094f2
osx: no CamelCase
...
Renamed types, functions, variables.
2009-02-26 21:03:06 +01:00
Max Kellermann
a7b0cfccb4
output_thread: use the right audio_format in assert()
...
ao_play() gets PCM data in the in_audio_format, and converts it to
out_audio_format. Comparing the input data with out_audio_format is
wrong.
prefixed with "STG:" will be automatically removed. STG: Trailing
empty lines will be automatically removed. STG: vi: set textwidth=75
filetype=diff nobackup:
2009-02-26 21:02:39 +01:00
Max Kellermann
bcc3a9debf
shout: use config_get_block_unsigned()
...
Eliminated manual integer parsing.
2009-02-26 19:34:00 +01:00
Max Kellermann
710a61a3dc
pulse: removed pa_simple!=NULL checks
...
The MPD core guarantees that the audio_output object is always
consistent, and our pa_simple!=NULL checks are superfluous. Also
don't manually close the device on error in pulse_play(), since the
MPD core does this automatically when the play() method returns 0.
2009-02-26 19:29:06 +01:00
Max Kellermann
4f2ac7ec2c
oss: moved code from oss_open() to oss_setup()
...
Eliminate one label and a bunch of gotos.
2009-02-26 19:18:16 +01:00
Max Kellermann
749d6c7766
oss: convert OSS_STAT_* to an enum
...
Use C instead of CPP.
2009-02-26 19:18:13 +01:00
Max Kellermann
a0b3f35537
oss: return bool instead of int
...
Return type of oss_find_supported_param(), oss_can_convert() and
oss_find_unsupported_param() should be bool instead of int.
2009-02-26 19:17:56 +01:00
Max Kellermann
e1f58fdcf5
oss: use unsigned integers
...
Convert the num_supported and num_unsupported variables from signed to
unsigned.
2009-02-26 19:17:09 +01:00
Max Kellermann
4958a6f56f
oss: no CamelCase
...
Renamed types, functions and variables.
2009-02-26 19:16:33 +01:00
Avuton Olrich
90ee488597
mixer: Add "disabled" mixer_type.
2009-02-26 09:13:07 -08:00
Avuton Olrich
1b79449ef1
cmdline: Alphabetical help order like other GNU projects.
2009-02-25 15:34:57 -08:00
Avuton Olrich
de07547426
cmdline: Add --no-config to explicitly set daemon default options.
2009-02-25 15:30:52 -08:00
Max Kellermann
a4cf7b7dfd
alsa: fall back to 16 bit audio
...
When the sample format is unknown, fall back to 16 bit samples.
2009-02-25 22:01:32 +01:00
Max Kellermann
4c1fb8278b
alsa: moved code from alsa_open() to alsa_setup()
...
Simplify error handling a bit by moving some code into a separate
function. This eliminates a good bunch of gotos, but that's not
finished yet.
2009-02-25 22:01:30 +01:00
Max Kellermann
d3409a65b5
mvp: check for reopen errors
...
When the MVP device has been closed in the cancel() method, and the
play() method attempts to reopen it, check for errors.
2009-02-25 21:57:02 +01:00
Max Kellermann
883e31d55b
mvp: moved code to mvp_find_sample_rate()
...
Moved the table lookup code to a separate function.
2009-02-25 21:56:48 +01:00
Max Kellermann
b4c65cac8c
mvp: make the mvp_sample_rates array const
...
The array must never be modified, it's a constant lookup table.
2009-02-25 21:54:02 +01:00
Max Kellermann
99f535ad77
mvp: fall back to 16 bit audio samples
...
Looks like the MVP audio output only supports 16 and 24 bit audio
samples. If MPD generates any other sample formats, force it to use
16 bit.
2009-02-25 21:52:11 +01:00
Max Kellermann
8491f61d6c
mvp: fall back to stereo
...
When the channel count is greater than 2, fall back to stereo sound.
2009-02-25 21:51:39 +01:00
Max Kellermann
6722c508a1
mvp: mvp_set_pcm_params() returns bool
...
Return true/false instead of 0/-1. Also check its return value in
mvp_output_open().
2009-02-25 21:51:36 +01:00
Max Kellermann
84ed6d4701
mvp: pass audio_format struct to mvp_set_pcm_params()
...
Pass a pointer to the audio_format struct instead of 3 separate
integers.
2009-02-25 21:51:32 +01:00
Max Kellermann
57a9e5605b
mvp: removed big_endian parameter from mvp_set_pcm_params()
...
Don't pass the big_endian flag to mvp_set_pcm_params(), do a simple
"G_BYTE_ORDER==G_LITTLE_ENDIAN" instead.
2009-02-25 21:51:13 +01:00
Max Kellermann
d902465375
mvp: use G_N_ELEMENTS(mvp_sample_rates)
...
Instead of manually calculating the number of elements in the
mvp_sample_rates array, use GLib's convenience macro G_N_ELEMENTS().
2009-02-25 21:50:50 +01:00
Max Kellermann
fff52ac5b9
mvp: no CamelCase
...
Renamed types, functions and variables.
2009-02-25 21:49:59 +01:00
Max Kellermann
6aa6def776
output: audio_output_init() returns bool
...
Return true/false instead of 1/0.
2009-02-25 19:53:56 +01:00
Max Kellermann
9512704055
output: set a GLib log domain
2009-02-25 19:53:38 +01:00
Max Kellermann
d56ae1e9c2
fifo: return bool values
...
Return true/false for success/failure instead of returning 0/-1.
2009-02-25 19:53:27 +01:00
Max Kellermann
74af4e4c3d
fifo: no CamelCase
...
Renamed types, functions and variables.
2009-02-25 19:53:24 +01:00
Max Kellermann
ee7cf9c9b8
fifo: removed timer!=NULL checks
...
The MPD core guarantees that the audio_output object is always
consistent, and our timer!=NULL checks are superfluous.
2009-02-25 19:09:38 +01:00
Max Kellermann
ba4dd651ef
ao: no CamelCase
...
Renamed functions and variables.
2009-02-25 19:08:49 +01:00
Max Kellermann
074d5ae13e
ao: removed AoData.device!=NULL checks
...
The MPD core guarantees that the audio_output object is always in a
consistent state: either open or closed. When open, it will not call
the open() method again, and when closed, it will not call play().
Removed several checks and the NULL initialization.
2009-02-25 18:48:27 +01:00
Max Kellermann
8a882209c3
ao: removed implementation of method cancel()
...
The method is empty, and we can simply set the method pointer to NULL
instead.
2009-02-25 18:45:09 +01:00
Max Kellermann
dcd84c19cd
output_plugin: don't pass audio_output object to method init()
...
audio_output_get_name() has been removed, which was the only function
left in output_api.h. The output plugin doesn't need the audio_output
object at all, remove the parameter from the init() method.
2009-02-25 18:34:02 +01:00
Max Kellermann
0cf4f09e4f
output_api: removed audio_output_get_name()
...
Use config_get_block_string("name") instead of audio_output_get_name().
2009-02-25 17:32:58 +01:00
Max Kellermann
6823217697
ls: moved generic URI utilities to uri.c
...
"ls" is a bad name for a library which parses URIs. We'll move the
rest of the "ls" library later.
2009-02-25 16:44:06 +01:00
Max Kellermann
2054464c01
vorbis_encoder: vorbis_encoder_clear() returns void
...
Don't return an uninitialized bool variable.
2009-02-24 19:06:37 +01:00
Max Kellermann
e065c4db33
jack: initialize local variable "space"
...
Fix a gcc warning, initialize the "space" variable at the beginning of
mpd_jack_play().
2009-02-24 19:06:34 +01:00
Max Kellermann
1630fe00a2
listen: fix unused parameter warnings when TCP is disabled
...
Work around gcc warnings by casting the parameters to void.
2009-02-24 19:06:31 +01:00
Max Kellermann
d0a17ffb9d
listen: removed is_ipv6_enabled()
...
Don't explicitly check is_ipv6_enabled(), just try calling
listen_add_port_ipv6(), but check its error code.
2009-02-24 18:55:12 +01:00
Max Kellermann
adf044eb09
listen: splitted listen_add_port() into IPv4 and IPv6
...
Some more code simplification.
2009-02-24 18:49:09 +01:00
Max Kellermann
d40c439424
listen: don't call listen_add_config_param(NULL)
...
For default bind_to_address settings, don't call
listen_add_config_param(NULL), use listen_add_port() directly.
2009-02-24 18:36:31 +01:00
Max Kellermann
739c23cca5
listen: moved code to listen_add_host()
...
Split code from the rather large function listen_add_config_param(),
part 3.
2009-02-24 18:29:53 +01:00
Max Kellermann
33749e7ea9
listen: moved code to listen_add_path()
...
Split code from the rather large function listen_add_config_param(),
part 2.
2009-02-24 17:51:39 +01:00
Max Kellermann
36b1a860d3
listen: moved code to listen_add_port()
...
Split code from the rather large function listen_add_config_param().
2009-02-24 17:51:32 +01:00
Max Kellermann
dbb067c016
listen: listen_add_address() returns bool/GError
...
Don't return -1 on failure, and abort on fatal error - do proper error
reporting with GError, and return false on failure.
2009-02-24 17:43:10 +01:00
Max Kellermann
7de4e7228f
listen: removed unused macro "MAXHOSTNAME"
2009-02-24 17:42:37 +01:00
Max Kellermann
9bb3f2d060
listen: no CamelCase
...
Renamed functions.
2009-02-24 17:42:36 +01:00
Avuton Olrich
39a33344f2
ffmpeg: add all known ffmpeg extensions and mime-types.
...
After much research[1][2][3] this should be the majority of currently
supported file extensions and mime-types for the currently supported
ffmpeg formats. This list maybe incomplete, but it's more complete
than anything else out there that I've been able to find. This list
needs to be updated every now and again as the ffmpeg sources support
more formats.
1. Sources
2. wiki.multimedia.cx
3. filext.com
2009-02-23 10:48:43 -08:00
Max Kellermann
3b1a9aeca0
Makefile.am: no recursive makefiles
...
Recursive Makefiles are inefficient and error prone (no proper way to
declare dependencies). Since there's no disadvantage in having one
single Makefile, let's do it.
2009-02-23 10:04:51 +01:00
Max Kellermann
a4dfab2aee
output: pass the music chunk pointer as void*, not char*
...
The meaning of the chunk depends on the audio format; don't suggest a
specific format by declaring the pointer as "char*", pass "void*"
instead.
2009-02-23 09:34:26 +01:00
Max Kellermann
5a898c15e7
output_api: play() returns a length
...
The old API required an output plugin to not return until all data
passed to the play() method is consumed. Some output plugins have to
loop to fulfill that requirement, and may block during that. Simplify
these, by letting them consume only part of the buffer: make play()
return the length of the consumed data.
2009-02-23 09:29:56 +01:00