Commit Graph

7747 Commits

Author SHA1 Message Date
Max Kellermann 2789493a5f PlayerThread: fix stuck MPD after song change (0.18.2 regression)
Commit 77c63511 caused MPD to become stuck right after a song change.
The problem was that at some point, the MusicBuffer became full, and
the DecoderThread working on the next song waits for the PlayerThread.
However, the PlayerThread was stuck in a loop of g_usleep() calls, and
never bothered to tell the DecoderThread that the MusicBuffer is not
full anymore.  This bug is very old, but its chance to occur went from
nearly 0% to nearly 100%.

The fix is to wake up the DecoderThread before waiting for it.  As a
side effect, I replaced the g_usleep() call with a Cond::Wait() call.
2013-11-08 12:02:21 +01:00
Max Kellermann 4ed0635447 DecoderInternal: simplify need_chunks()
Remove the "do_wait" parameter which is always true.  Check only
command==NONE and merge the "return" statements.
2013-11-08 11:59:56 +01:00
Max Kellermann 1904e504be DecoderInternal: don't wake up player in need_chunks
Nothing of interest happens here.  No need to wake up the player.
2013-11-08 11:58:23 +01:00
Max Kellermann 834715ea2f configure.ac: prepare for 0.18.3 2013-11-08 11:57:37 +01:00
Max Kellermann 380a3bbff4 release v0.18.2 2013-11-07 18:48:04 +01:00
Max Kellermann 6219326e02 doc: more information about "close" 2013-11-07 18:41:53 +01:00
Max Kellermann 6c4de5106b doc: remove documentation on obsolete tcp_keep_alive options 2013-11-07 18:39:55 +01:00
Max Kellermann e936705840 doc: add link to user manual 2013-11-07 18:36:55 +01:00
Max Kellermann 9b2603b6f6 doc: update current maintainer 2013-11-07 18:34:57 +01:00
Max Kellermann 88856b847c doc: update Mantis link 2013-11-07 18:34:04 +01:00
Max Kellermann f679878f7b doc/user: add more documentation for the proxy database plugin 2013-11-07 18:31:56 +01:00
Max Kellermann f33acf8758 input/cdio_paranoia: add setting "default_byte_order"
Allows big-endian users to configure the fallback byte order to
little-endian.  Without this setting, MPD assumes native byte order if
the CD drive can't decide.
2013-11-07 18:17:54 +01:00
Max Kellermann a846a4c643 AvahiPoll: don't close the dbus socket
Avoid closing it twice.
2013-11-07 01:10:07 +01:00
Max Kellermann 899c2bb9cc input/curl: unregister removed sockets from epoll
Fixes a crash bug.  See code comment.
2013-11-07 01:10:07 +01:00
Max Kellermann f8f95e2dbd OutputControl: reduce the number of OutputThread wakeups
Wake up the OutputThread only if it hasn't already been woken up and
if it isn't already in the playback loop.
2013-11-06 23:51:17 +01:00
Max Kellermann 77c63511d8 PlayerThread: reduce the number of DecoderThread wakeups
After the number of decoded chunks has fallen below the threshold, the
PlayerThread woke up the DecoderThread over and over.  This commit
adds a boolean flag that avoids these duplicate wakeups, and thus
reduces the number of system calls.
2013-11-06 23:51:17 +01:00
Max Kellermann 0be5a6ab2b DecoderControl: reduce the number of PlayerThread wakeups
Wake up the PlayerThread only if it is really waiting for the decoder.
This greatly reduces the number of system calls in the DecoderThread.
2013-11-06 23:51:17 +01:00
Max Kellermann 9802e74859 DecoderInternal: lock DecoderControl in _flush_chunk()
Must hold the Mutex to signal the Cond object safely.
2013-11-06 23:51:17 +01:00
Max Kellermann 8e7d6eb151 DecoderInternal: wake up the player thread in _flush_chunk()
Merge duplicate code.
2013-11-06 23:51:17 +01:00
Max Kellermann 5c18e4f114 event/FullyBufferedSocket: remove obsolete TODO comment
We have a better solution now.
2013-11-06 23:50:36 +01:00
Max Kellermann fd2eafa7c6 ClientRead: "close" flushes the output buffer
Add a new CommandResult code called "FINISH" which, unlike "CLOSE",
will attempt to flush the output buffer.  This is a one-shot attempt;
it will do one write, and not try again.
2013-11-06 22:01:06 +01:00
Max Kellermann 422b8472fe event/FullyBufferedSocket: try to write without extra roundtrip
Postpone the write using IdleMonitor instead of scheduling a write
event.  This reduces the number of system calls, because we don't need
to register and unregister the write event in epoll.
2013-11-06 21:52:24 +01:00
Max Kellermann 5b213b0504 event/FullyBufferedSocket: make WriteFromBuffer() protected
.. and rename it to Flush().
2013-11-06 21:52:09 +01:00
Max Kellermann ad27d06979 PlayerThread: enable buffering when starting playback
For some reason, this got lost in commit 975deca8.

Re-enabling this fixes stuttering at the beginning of radio streams.
2013-11-06 20:14:38 +01:00
Max Kellermann c4b1251d0a configure.ac: require libaudiofile 0.3 due to API breakage
Prior to version 0.3, the "length" callback returned a "long" instead
of AFfileoffset.  Now that this API bug fix is a few years old, let's
drop 0.2 support for good.
2013-11-06 20:04:21 +01:00
Max Kellermann 01891f8815 input/curl: fix bug with redirected streams
Migrate from the old curl_multi_perform() API to the newer
curl_multi_socket_action() API (since CURL 7.16).

This allows working around a bug with HTTP redirections with epoll:
when CURL closes a socket and the new one happens to have the same
file number, MPD did not have a chance to remove the old one from
epoll and subsequently attempted to use EPOLL_CTL_MOD, which was not
allowed by epoll, because it's a new socket now.
2013-11-06 19:14:22 +01:00
Max Kellermann adb68450ce input/curl: move code into class CurlMulti
Move all global variables there, and keep just one global variable:
the pointer to the CurlMulti instance.  Prepares for the next commit.
2013-11-06 19:07:10 +01:00
Max Kellermann 2520f6fe49 input/curl: remove the global list of requests
Unused.
2013-11-06 19:06:14 +01:00
Max Kellermann c9278bfcdf input/curl: don't abort all requests on curl_multi_perform() error
Eliminate some complicated code that's not worth the trouble.
2013-11-06 19:06:02 +01:00
Max Kellermann 8b838ff9ea input/curl: use CURLOPT_PRIVATE
Replaces the loop in input_curl_find_request().
2013-11-06 19:05:45 +01:00
Max Kellermann 154bdf0bca event/SocketMonitor: add method Abandon() 2013-11-06 19:05:45 +01:00
Max Kellermann ed436c6f0c system/ByteOrder: fix big-endian support
D'oh!
2013-11-05 22:08:53 +01:00
Max Kellermann ae5dd2da4f playlist/pls: fix reversed song order
Remove the forward_list::reverse() call.  It was not necessary,
because pls_parser() already reads the playlist in reverse order.
2013-11-05 18:22:34 +01:00
Jurgen Kramer f4b61e8c8d decoder/dsf: enable DSD128 2013-11-05 17:38:48 +01:00
Max Kellermann e49a3d377f NEWS: add missing line 2013-11-05 17:38:41 +01:00
Max Kellermann b631b552bb test/*: add more missing stdlib.h includes 2013-11-05 17:28:23 +01:00
Natanael Copa 3f21581a81 add various missing headers
Fixes building with gcc-4.8

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2013-11-05 11:08:36 +01:00
Max Kellermann bb62ecf157 configure.ac: prepare for 0.18.2 2013-11-05 11:08:17 +01:00
Max Kellermann a268ab35ea release v0.18.1 2013-11-04 23:46:14 +01:00
Max Kellermann 62baec1841 output/alsa: avoid endless loop in Raspberry Pi workaround
See code comment.
2013-11-04 23:40:34 +01:00
Max Kellermann 7bca61f5bb event/ServerSocket: don't abort if IPv6 is not available
First check if an IPv6 socket can be created.
2013-11-04 23:36:02 +01:00
Max Kellermann ecf12a60e8 Log: add level "DEFAULT"
Map LogLevel::INFO to G_LOG_LEVEL_INFO, and LogLevel::DEFAULT to
G_LOG_LEVEL_MESSAGE.  Now client connect/disconnect message are only
logged on log_level "secure".
2013-11-04 22:27:49 +01:00
Max Kellermann 6de85cb047 Log: document the LogLevel items 2013-11-04 22:17:53 +01:00
Max Kellermann 39257717d8 test/test_mixramp: add threshold to floating point comparisons
Fixes bogus test failures on Debian build machines due to rounding
errors (hopefully).
2013-11-04 22:08:59 +01:00
Max Kellermann b54762a8f6 event/ServerSocket: fix assertion failure
Regression from previous commit.  D'oh!
2013-11-04 20:16:28 +01:00
Max Kellermann bcae86196c event/ServerSocket: open sockets in the order they were configured
Use a std::list which can be appended at the end.
2013-11-04 20:10:46 +01:00
Max Kellermann 7adfea8ca2 system/resolver: return path of UNIX domain sockets
getnameinfo() doesn't work well - it always returns "localhost".
2013-11-04 19:13:05 +01:00
Max Kellermann eab1a77683 ClientRead: always ignore whitespace at the end of the line 2013-11-04 18:11:15 +01:00
Max Kellermann 84f5e0c0de Makefile.am: distribute missing files 2013-11-04 08:26:10 +01:00
Max Kellermann 2ce3900071 filter/AutoConvert: modify child_audio_format, not in_audio_format
This prevented using the "volume_normalization" feature with some
codecs (e.g. mp3), because the normalization code requires 16 bit
samples.  If the codec happens to deliver formats other than S16, the
AutoConvert filter succeeds to initialize the conversion filter, but
the returned input audio format was wrong.
2013-11-04 08:00:00 +01:00