Max Kellermann
6a5f4651a1
test: fixed the read_mixer program on !HAVE_PULSE
2009-11-10 21:38:20 +01:00
Max Kellermann
70106464d3
configure.ac: enable_audiofile defaults to "auto"
...
Since we're using MPD_AUTO_PKG, we can auto-detect this option. Also
fix the --enable-audiofile help string.
2009-11-10 21:27:55 +01:00
Max Kellermann
b722d3d7f3
configure.ac: require GLib 2.12
...
Drop the required GLib version from 2.16 to 2.12, because many current
systems still don't have GLib 2.16. This requires several new
compatibility functions in glib_compat.h.
2009-11-10 21:14:22 +01:00
Max Kellermann
de57c21a3b
Merge branch 'v0.15.x'
...
Conflicts:
src/input/lastfm_input_plugin.c
src/song_save.c
2009-11-10 21:13:03 +01:00
Max Kellermann
84917721c7
moved GLib compatibility code to glib_compat.h
2009-11-10 21:07:54 +01:00
Max Kellermann
93a13b42dd
zzip: require libzzip 0.13
...
We need the function zzip_file_stat().
2009-11-10 21:00:10 +01:00
Max Kellermann
96fcf5e1a5
input/mms: require libmms 0.4
...
We're using API functions which are not available in 0.3.
2009-11-10 20:57:10 +01:00
Max Kellermann
937b2b1744
sticker: added fallback for sqlite3_prepare_v2()
...
This function was not present in SQLite < 3.4.
2009-11-10 20:55:29 +01:00
Max Kellermann
8c0680f6b9
input/lastfm: fixed variable name in GLib<2.16 code path
...
Should be "lastfm_user", not "lastfm_username".
2009-11-10 20:54:17 +01:00
Max Kellermann
118495d372
decoder/flac: pass void pointer to flac_convert()
...
That function diverts into various bit formats; it doesn't need a
typed pointer.
2009-11-10 19:57:58 +01:00
Max Kellermann
a6bee71f1a
decoder/flac: pass audio_format.bits to flac_convert()
...
Don't use audio_format_sample_size() for identifying the sample
format.
2009-11-10 19:57:28 +01:00
Max Kellermann
e0e6813a1d
fd_util: removed creat_cloexec()
...
Add a "mode" argument to open_cloexec() instead.
2009-11-10 16:53:24 +01:00
Max Kellermann
3d2a9d3545
fd_util: added function pipe_cloexec()
...
Same as pipe_cloexec_nonblock(), but doesn't set non-blocking mode.
2009-11-10 16:53:20 +01:00
Max Kellermann
6975c087e0
decoder_list: fix decoder_plugin_from_mime_type()
...
Copy'n'paste error: call decoder_plugin_supports_mime_type() instead
of decoder_plugin_supports_suffix().
2009-11-09 22:49:05 +01:00
Max Kellermann
54033c74e4
output/alsa: fill period buffer with silence before draining
...
ALSA passes full period buffers to the hardware. If an application
doesn't finish writing a period, libasound will nonetheless send the
partial buffer (with undefined trailing data). This causes noise at
the end of playback. This patch attempts to track the current
position within the period buffer, and generates silence at the end,
before calling snd_pcm_drain().
2009-11-09 22:22:31 +01:00
Max Kellermann
8420f1420f
player_thread: drain audio outputs at the end of the playlist
...
When there's no queued song, and the current one has finished playing,
first make sure that the hardware outputs have really finished playing
the last chunk: call the drain() method in all audio outputs. Without
this patch, MPD stopped playback shortly before the ALSA sound card
had finished playing.
2009-11-09 22:22:27 +01:00
Max Kellermann
3359f8785e
output_thread: added command DRAIN
...
This command manually drains the hardware buffer. This is useful when
the player thread want to make sure that everything has been played.
2009-11-09 22:16:26 +01:00
Max Kellermann
96b974bc45
player_control: removed the "volatile" attribute
...
Our use of the "volatile" keyword was wrong from the start, and now
that we have proper locking, we can safely remove all of them.
2009-11-09 20:33:45 +01:00
Max Kellermann
1a4025420c
fd_util: added missing NONBLOCK fallback for socket()
2009-11-08 22:24:02 +01:00
Max Kellermann
223b0db5bd
fd_util: relicense under BSD 2-clause
...
We'll copy this code to libmpdclient, and that's easier if its license
is BSD.
2009-11-08 22:15:22 +01:00
Max Kellermann
2f4144e1cd
utils: removed function set_nonblocking()
...
It's not used anymore, its features have been moved to fd_util.c.
2009-11-08 22:11:37 +01:00
Max Kellermann
f66edccffd
fd_util: added O_NONBLOCK functions
...
Changed the wrappers for pipe(), socket(), accept(). On WIN32, this
does not work for pipe().
2009-11-08 22:11:35 +01:00
Max Kellermann
b043ade456
fd_util: fixed typo in API documentation
2009-11-08 22:07:14 +01:00
Max Kellermann
217b494cc5
encoder/null: removed empty close() method
...
That's an optional method.
2009-11-08 21:44:01 +01:00
Max Kellermann
5ef62312af
encoder/null: removed unused audio_format attribute
2009-11-08 21:43:19 +01:00
Max Kellermann
5479ed7cfb
fd_util: added API documentation
2009-11-08 21:38:52 +01:00
Max Kellermann
cac63bfd21
fd_util: unexport fd_set_cloexec()
...
This function is used only internally.
2009-11-08 21:38:38 +01:00
Max Kellermann
1573ea1485
inotify: set close-on-exec flag
...
Added wrapper for inotify_init1() to fd_util.c.
2009-11-07 19:02:53 +01:00
Max Kellermann
e3af0032b2
set the close-on-exec flag on all file descriptors
...
Added the "fd_util" library, which attempts to use the new thread-safe
Linux system calls pipe2(), accept4() and the options O_CLOEXEC,
SOCK_CLOEXEC. Without these, it falls back to FD_CLOEXEC, which is
not thread safe.
This is particularly important for the "pipe" output plugin (and
others, such as JACK/PulseAudio), because we were heavily leaking file
descriptors to child processes.
2009-11-07 18:55:16 +01:00
Max Kellermann
9b21152600
decoder_thread: close input file
...
An input_stream_close() call was missing after today's code
reorganization.
2009-11-07 17:58:52 +01:00
Max Kellermann
c440faa94d
log: redirect stdout/stderr to /dev/null if syslog is used
...
Don't hold a file descriptor on root's tty when syslog is used for
logging.
2009-11-07 17:48:57 +01:00
Max Kellermann
375fd5ed4c
output/jack: added option "server_name"
2009-11-07 17:26:21 +01:00
Max Kellermann
ec25cda68b
output_all: automatically attempt to re-enable failed outputs
...
When an output's enable() method has failed, and playback starts,
retry to enable it. Without this, the user may be confused, because
he sees the device is "enabled" but cannot use it, and currently there
is no error message in the log.
2009-11-07 17:22:34 +01:00
Max Kellermann
c9f726048c
output/httpd: moved code to httpd_output_bind()
2009-11-07 16:52:44 +01:00
Max Kellermann
c2251dc5a2
exclude: use GPatternSpec instead of fnmatch()
...
GLib's version of fnmatch() is more portable.
2009-11-07 16:29:29 +01:00
Max Kellermann
a505cbc6c9
added missing source file decoder_print.c
2009-11-07 16:28:21 +01:00
Max Kellermann
c422344190
database: I/O error handling in db_save()
...
Check ferror() instead of the fprintf() return value.
2009-11-07 16:20:07 +01:00
Max Kellermann
1a4cfc3d90
update_walk: log new container files
2009-11-07 16:03:25 +01:00
Max Kellermann
2f1bd39be8
command: added command "decoders"
...
This command prints a list of decoder plugins and their suffixes /
MIME types.
2009-11-07 15:57:22 +01:00
Max Kellermann
4624dfcb30
decoder_list: moved print_all_decoders() to cmdline.c
...
Export the decoder_plugins array. The function
decoder_plugin_print_all_decoders() it is UI specific and should not
live in this backend library.
2009-11-07 15:46:45 +01:00
Max Kellermann
3546d931a1
decoder_thread: check for STOP before calling the plugin
...
Before calling the plugin's decode method, we should ensure that we
didn't receive a STOP command during initialization.
2009-11-07 15:37:18 +01:00
Max Kellermann
4dadb965a7
decoder_thread: moved code to decoder_input_stream_open()
...
This function opens the stream and waits for it to become ready;
meanwhile it checks for STOP commands. It is code moved from
decoder_run_stream().
2009-11-07 15:35:50 +01:00
Max Kellermann
f2184db1cd
decoder_thread: added local variable "dc" in decoder_run_file()
...
Simplify the expressions.
2009-11-07 15:24:38 +01:00
Max Kellermann
41f3f12709
output/jack: free source port names on exit
...
Make valgrind happy.
2009-11-07 15:17:48 +01:00
Max Kellermann
5d55b45654
decoder_list: pass previous plugin pointer to lookup functions
...
Remove the static integer hack, that's not thread safe and sucks.
2009-11-07 15:14:16 +01:00
Max Kellermann
e3da174fca
decoder_list: moved suffix/mime_type checks to decoder_plugin.c
2009-11-07 15:14:11 +01:00
Max Kellermann
bb862a8ceb
decoder_list: back to NULL terminated list
...
A NULL terminated list is easier to iterate.
2009-11-07 15:14:09 +01:00
Max Kellermann
9ba900486e
decoder_thread: open input stream on demand
...
Moved the global input stream opener to decoder_run_stream().
decoder_run_file() now opens the input stream each time a plugin
provides a stream decoder method.
2009-11-07 15:10:12 +01:00
Max Kellermann
587284bae6
decoder_thread: moved plugin loops to separate functions
...
Tame the large decoder_run_song() function.
2009-11-07 14:57:46 +01:00
Max Kellermann
4c7bfa514f
uri: added function attributes
...
Let gcc optimize a little bit more.
2009-11-07 14:17:28 +01:00