Compare commits

...

21 Commits

Author SHA1 Message Date
Max Kellermann
35297f8d4f release v0.18.4 2013-11-13 18:26:01 +01:00
Max Kellermann
6f4202408c doc/example: remove "format" and "audio_output_format"
Just an attempt to prevent users from shooting themselves in the foot
by uncommenting these lines without knowing what they're doing.
2013-11-11 17:18:29 +01:00
Max Kellermann
0b6548a282 util/RefCount: no "constexpr" with libc++
Not supported by libc++.
2013-11-11 12:27:16 +01:00
Max Kellermann
faf5821816 util/LazyRandomEngine: make min()/max() static+constexpr
Required for building with libc++.
2013-11-11 12:27:15 +01:00
Max Kellermann
188673b746 output/httpd: don't use incomplete template argument with libc++ 2013-11-11 08:31:50 +01:00
Max Kellermann
287c70e361 filter/route, ...: add missing stdlib.h includes 2013-11-11 08:20:09 +01:00
Max Kellermann
f6b44af998 DespotifyUtils: add missing stdio.h include 2013-11-11 08:20:09 +01:00
Max Kellermann
84c3d9674f DecoderAPI: add missing math.h include 2013-11-11 08:18:54 +01:00
Jurgen Kramer
47d3758820 decoder/dsdiff: fix byte order bug 2013-11-10 16:49:39 +01:00
Max Kellermann
573ff3a24f DecoderThread: add missing <functional> include 2013-11-09 09:54:12 +01:00
Max Kellermann
32fcc22cb3 configure.ac: prepare for 0.18.4 2013-11-09 09:52:51 +01:00
Max Kellermann
daba1238b5 release v0.18.3 2013-11-08 12:55:12 +01:00
Max Kellermann
d125567f4a doc/developer: add text from the wiki 2013-11-08 12:54:16 +01:00
Max Kellermann
993eca9327 Makefile.am: disable dist-bzip2
bzip2-compressed tarballs are obsolete, xz is better and widely
understood.
2013-11-08 12:29:56 +01:00
Max Kellermann
e314844a4d doc: show .tar.xz in sample unpack command 2013-11-08 12:29:04 +01:00
Max Kellermann
017bc564af doc: replace the remaining wikia links 2013-11-08 12:26:07 +01:00
Max Kellermann
e076ff9085 DecoderAPI: log without holding mutex 2013-11-08 12:15:05 +01:00
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
21 changed files with 139 additions and 55 deletions

17
INSTALL

@@ -3,9 +3,11 @@
Introduction
------------
This document is a very small amount of documentation about what is needed to
install MPD. If more information is desired see the community wiki at
http://mpd.wikia.com.
install MPD. If more information is desired, read the user manual:
http://www.musicpd.org/doc/user/
Dependencies
------------
@@ -161,13 +163,9 @@ Get the latest release from of MPD from <http://www.musicpd.org/>.
Compile
-------
1) unzip and untar the archive
1) unpack the archive
$ tar zxvf mpd-x.x.x.tar.gz
or
$ tar jxvf mpd-x.x.x.tar.bz2
$ tar xf mpd-x.x.x.tar.xz
2) change to directory created
@@ -208,6 +206,5 @@ Using MPD
---------
You can download many different interfaces for MPD at
<http://mpd.wikia.com/wiki/Clients>
MPD can be interfaced directly using telnet (see COMMANDS, if you are brave).
http://www.musicpd.org/clients/

@@ -1,5 +1,5 @@
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign 1.11 dist-bzip2 dist-xz subdir-objects
AUTOMAKE_OPTIONS = foreign 1.11 dist-xz subdir-objects
AM_CPPFLAGS += -I$(srcdir)/src $(GLIB_CFLAGS)

9
NEWS

@@ -1,3 +1,12 @@
ver 0.18.4 (2013/11/13)
* decoder
- dsdiff: fix byte order bug
* fix build failures due to missing includes
* libc++ compatibility
ver 0.18.3 (2013/11/08)
* fix stuck MPD after song change (0.18.2 regression)
ver 0.18.2 (2013/11/07)
* protocol:
- "close" flushes the output buffer

@@ -1,6 +1,6 @@
AC_PREREQ(2.60)
AC_INIT(mpd, 0.18.2, musicpd-dev-team@lists.sourceforge.net)
AC_INIT(mpd, 0.18.4, musicpd-dev-team@lists.sourceforge.net)
VERSION_MAJOR=0
VERSION_MINOR=18
@@ -8,7 +8,7 @@ VERSION_REVISION=0
VERSION_EXTRA=0
AC_CONFIG_SRCDIR([src/Main.cxx])
AM_INIT_AUTOMAKE([foreign 1.11 dist-bzip2 dist-xz subdir-objects])
AM_INIT_AUTOMAKE([foreign 1.11 dist-xz subdir-objects])
AM_SILENT_RULES
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])

@@ -68,12 +68,28 @@ foo(const char *abc, int xyz)
<chapter>
<title>Hacking The Source</title>
<para>
MPD sources are managed in a git repository on <ulink
url="http://git.musicpd.org/">git.musicpd.org</ulink>.
</para>
<para>
Always write your code against the latest git:
</para>
<programlisting>git clone git://git.musicpd.org/master/mpd.git</programlisting>
<para>
If you already have a clone, update it:
</para>
<programlisting>git pull --rebase git://git.musicpd.org/master/mpd.git master</programlisting>
<para>
You can do without "--rebase", but we recommend that you rebase
your repository on the "master" repository all the time.
</para>
<para>
Configure with the options <option>--enable-debug
--enable-werror</option>. Enable as many plugins as possible,
@@ -83,8 +99,55 @@ foo(const char *abc, int xyz)
<para>
Don't mix several changes in one single patch. Create a
separate patch for every change. Tools like
<application>stgit</application> help you with that.
<application>stgit</application> help you with that. This way,
we can review your patches more easily, and we can pick the
patches we like most first.
</para>
<section>
<title> Basic stgit usage</title>
<para>
stgit allows you to create a set of patches and refine all of
them: you can go back to any patch at any time, and re-edit it
(both the code and the commit message). You can reorder
patches and insert new patches at any position. It encourages
creating separate patches for tiny changes.
</para>
<para>
stgit needs to be initialized on a git repository: stg init
</para>
<para>
Before you edit the code, create a patch: stg new
my-patch-name (stgit now asks you for the commit message).
</para>
<para>
Now edit the code. Once you're finished, you have to "refresh"
the patch, i.e. your edits are incorporated into the patch you
have created: stg refresh
</para>
<para>
You may now continue editing the same patch, and refresh it as
often as you like. Create more patches, edit and refresh them.
</para>
<para>
To view the list of patches, type stg series. To go back to a
specific patch, type stg goto my-patch-name; now you can
re-edit it (don't forget stg refresh when you're finished with
that patch).
</para>
<para>
When the whole patch series is finished, convert stgit patches
to git commits: stg commit
</para>
</section>
</chapter>
<chapter>

@@ -1,5 +1,5 @@
# An example configuration file for MPD
# See the mpd.conf man page for a more detailed description of each parameter.
# An example configuration file for MPD.
# Read the user manual for documentation: http://www.musicpd.org/doc/user/
# Files and directories #######################################################
@@ -204,16 +204,12 @@ input {
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
# See <http://mpd.wikia.com/wiki/Configuration#Audio_Outputs> for examples of
# other audio outputs.
#
# An example of an ALSA output:
#
#audio_output {
# type "alsa"
# name "My ALSA Device"
## device "hw:0,0" # optional
## format "44100:16:2" # optional
## mixer_type "hardware" # optional
## mixer_device "default" # optional
## mixer_control "PCM" # optional
@@ -226,7 +222,6 @@ input {
# type "oss"
# name "My OSS Device"
## device "/dev/dsp" # optional
## format "44100:16:2" # optional
## mixer_type "hardware" # optional
## mixer_device "/dev/mixer" # optional
## mixer_control "PCM" # optional
@@ -330,12 +325,6 @@ input {
# mixer_type "none" # optional
#}
#
# This setting will change all decoded audio to be converted to the specified
# format before being passed to the audio outputs. By default, this setting is
# disabled.
#
#audio_output_format "44100:16:2"
#
# If MPD has been compiled with libsamplerate support, this setting specifies
# the sample rate converter to use. Possible values can be found in the
# mpd.conf man page or the libsamplerate documentation. By default, this is

@@ -67,11 +67,11 @@
<para>
Download the source tarball from <ulink
url="http://mpd.wikia.com/wiki/Server">the MPD home
url="http://www.musicpd.org/download.html">the MPD home
page</ulink> and unpack it:
</para>
<programlisting>tar xjf mpd-version.tar.bz
<programlisting>tar xf mpd-version.tar.xz
cd mpd-version</programlisting>
<para>
@@ -630,7 +630,7 @@ systemctl start mpd.socket</programlisting>
</para>
<para>
The <ulink url="http://mpd.wikia.com/wiki/Clients">MPD
The <ulink url="http://www.musicpd.org/clients/">MPD
Wiki</ulink> contains an extensive list of clients to choose
from.
</para>

@@ -35,6 +35,7 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
void
decoder_initialized(Decoder &decoder,
@@ -283,11 +284,11 @@ decoder_read(Decoder *decoder,
assert(nbytes == 0 || !error.IsDefined());
assert(nbytes > 0 || error.IsDefined() || is.IsEOF());
is.Unlock();
if (gcc_unlikely(nbytes == 0 && error.IsDefined()))
LogError(error);
is.Unlock();
return nbytes;
}

@@ -42,20 +42,12 @@ Decoder::~Decoder()
* one.
*/
static DecoderCommand
need_chunks(DecoderControl &dc, bool do_wait)
need_chunks(DecoderControl &dc)
{
if (dc.command == DecoderCommand::STOP ||
dc.command == DecoderCommand::SEEK)
return dc.command;
if (do_wait) {
if (dc.command == DecoderCommand::NONE)
dc.Wait();
dc.client_cond.signal();
return dc.command;
}
return DecoderCommand::NONE;
return dc.command;
}
struct music_chunk *
@@ -80,7 +72,7 @@ decoder_get_chunk(Decoder &decoder)
}
dc.Lock();
cmd = need_chunks(dc, true);
cmd = need_chunks(dc);
dc.Unlock();
} while (cmd == DecoderCommand::NONE);

@@ -38,6 +38,8 @@
#include "tag/ApeReplayGain.hxx"
#include "Log.hxx"
#include <functional>
static constexpr Domain decoder_thread_domain("decoder_thread");
/**

@@ -28,6 +28,8 @@ extern "C" {
#include <despotify.h>
}
#include <stdio.h>
const Domain despotify_domain("despotify");
static struct despotify_session *g_session;

@@ -36,8 +36,6 @@
#include "util/Domain.hxx"
#include "Log.hxx"
#include <glib.h>
#include <string.h>
static constexpr Domain player_domain("player");
@@ -1043,8 +1041,14 @@ Player::Run()
output thread is still busy, so it's
okay */
/* XXX synchronize in a better way */
g_usleep(10000);
pc.Lock();
/* wake up the decoder (just in case it's
waiting for space in the MusicBuffer) and
wait for it */
dc.Signal();
dc.WaitForDecoder();
continue;
} else if (IsDecoderAtNextSong()) {
/* at the beginning of a new song */

@@ -30,6 +30,7 @@
#include "util/Domain.hxx"
#include <string.h>
#include <stdlib.h>
#define SONG_MTIME "mtime"
#define SONG_END "song_end"

@@ -47,6 +47,17 @@ public:
}
};
class DffDsdUint64 {
uint32_t hi;
uint32_t lo;
public:
constexpr uint64_t Read() const {
return (uint64_t(FromBE32(hi)) << 32) |
uint64_t(FromBE32(lo));
}
};
bool
dsdlib_read(Decoder *decoder, InputStream &is,
void *data, size_t length);

@@ -43,13 +43,13 @@
struct DsdiffHeader {
DsdId id;
DsdUint64 size;
DffDsdUint64 size;
DsdId format;
};
struct DsdiffChunkHeader {
DsdId id;
DsdUint64 size;
DffDsdUint64 size;
/**
* Read the "size" attribute from the specified header, converting it

@@ -34,6 +34,7 @@
#include <glib.h>
#include <assert.h>
#include <stdlib.h>
struct opus_encoder {
/** the base class */

@@ -56,6 +56,7 @@
#include <assert.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
class RouteFilter final : public Filter {
/**

@@ -30,6 +30,11 @@
#include "thread/Mutex.hxx"
#include "event/ServerSocket.hxx"
#ifdef _LIBCPP_VERSION
/* can't use incomplete template arguments with libc++ */
#include "HttpdClient.hxx"
#endif
#include <forward_list>
struct config_param;

@@ -49,12 +49,12 @@ public:
*/
void AutoCreate();
result_type min() const {
return engine->min();
static constexpr result_type min() {
return std::mt19937::min();
}
result_type max() const {
return engine->max();
static constexpr result_type max() {
return std::mt19937::max();
}
result_type operator()() {

@@ -42,7 +42,12 @@ class RefCount {
std::atomic_uint n;
public:
constexpr RefCount():n(1) {}
#ifndef _LIBCPP_VERSION
/* the "constexpr" is missing in libc++'s "atomic"
implementation */
constexpr
#endif
RefCount():n(1) {}
void Increment() {
++n;

@@ -36,6 +36,7 @@
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
static void