Commit Graph

11712 Commits

Author SHA1 Message Date
Max Kellermann 98c47d9d36 Instance: remove FinishShutdownPartitions()
The list of partitions is cleared automatically.
2019-02-05 22:53:02 +01:00
Max Kellermann 6c67408944 event/Loop: add flag `alive`
This replaces the old `dead` flag which was unreliable; it was `false`
if the EventThread was not yet started, which could cause deadlocks in
BlockingCall().
2019-02-05 22:38:45 +01:00
Max Kellermann 261a816b21 command/AllCommands: remove empty function command_finish() 2019-02-05 22:15:41 +01:00
Max Kellermann 7a23c123c8 decoder/List: add RAII class 2019-02-05 22:12:22 +01:00
Max Kellermann e85b24bee0 decoder/List: add `noexcept` 2019-02-05 22:11:51 +01:00
Max Kellermann 9e73ea77b4 input/Init: add RAII class 2019-02-05 22:07:49 +01:00
Max Kellermann 848f6aa5ab Main: stop io_thread and rtio_thread automatically
They will be stopped by ~EventThread() when the `Instance` is deleted.
2019-02-05 21:49:59 +01:00
Max Kellermann c9ba4f3f9c archive/List: add RAII class 2019-02-05 21:40:07 +01:00
Max Kellermann c0e9246a66 archive/List: add `noexcept` 2019-02-05 21:38:46 +01:00
Max Kellermann 096c23f27d unix/SignalHandlers: add RAII class 2019-02-05 21:36:51 +01:00
Max Kellermann 40bde1eac9 unix/SignalHandlers: add `noexcept` 2019-02-05 21:36:35 +01:00
Max Kellermann 4b55ed17a9 LogInit: add `noexcept` 2019-02-05 21:36:35 +01:00
kaliko ff1ff1e54a Fixed typo in TagMask 2019-02-02 15:14:31 +01:00
Yue Wang 42b22187c8
[OSXOutput] Throw an error when device not found
Currently it falls back to system default device (either internal speaker or headphone) when device not found. 
I believe it is a better to fail in this case, to make it better aligned with platforms (such as alsa).
2019-01-25 19:50:27 -08:00
Max Kellermann cfe22502ab fs/io/StdioOutputStream: add `noexcept` 2019-01-22 09:03:49 +01:00
Max Kellermann d77b0c7dcd net/SocketAddress: add `constexpr` 2019-01-22 08:42:35 +01:00
Max Kellermann 5cf889b676 util/WStringView: add missing include 2019-01-22 08:38:03 +01:00
Max Kellermann ffc36d5255 input/buffered: implement seeking to end of file
Previously, a seek to the end of the file would cause an assertion
failure in SparseMap::Check() because the given offset was invalid.

Closes #453
2019-01-22 07:42:00 +01:00
Max Kellermann 0126276e2f FileCommands: log irregular errors while looking for cover art 2019-01-21 22:21:11 +01:00
Max Kellermann 58d6ddab9e FileCommands: catch all exceptions 2019-01-21 22:19:32 +01:00
Max Kellermann 05db6934eb FileCommands: fix deadlock in "albumart" command
Must lock the mutex before calling any of the unprotected InputStream methods.

Closes #462
2019-01-21 22:16:46 +01:00
Max Kellermann 02c68c5cdb net/HostParser: add `noexcept` 2019-01-21 21:20:43 +01:00
Max Kellermann b02fee7309 util/PrintException: support "const char *" 2019-01-21 21:19:35 +01:00
Max Kellermann 424f75c9e1 util/OffsetPointer: remove redundant `inline` keywords from `constexpr` functions 2019-01-21 21:19:09 +01:00
Max Kellermann f6e1176f97 util/CharUtil: remove redundant `inline` keywords from `constexpr` functions 2019-01-21 21:18:23 +01:00
Max Kellermann e4700c0a27 util/Cast: remove redundant `inline` keywords from `constexpr` functions 2019-01-21 21:17:58 +01:00
Max Kellermann cf23fd8774 fs/io/FileOutputStream: add constructor with directory fd 2019-01-21 21:10:02 +01:00
Max Kellermann dee8872395 fs/io/FileOutputStream: move code to Open() 2019-01-21 21:09:34 +01:00
Max Kellermann 4ba9357a9c input/CdioParanoia: C++ wrappers for libcdio types 2019-01-21 20:20:20 +01:00
Max Kellermann 754f4048a8 output/shout: evaluate `tls` option only if TLS is enabled in libshout
Fixes build failure after commit
0cea67ee70
2019-01-21 14:36:43 +01:00
Max Kellermann 037bb07d08 db/VHelper: include DetachedSong.hxx to fix GCC 9 build failure
GCC 9's libstdc++ is unable to use forward-declared types as
std::vector item because the compiler wants to resolve `noexcept()` on
the item destructor.
2019-01-21 14:34:12 +01:00
Max Kellermann 87635c5268 input/CdioParanoia: use the new function names 2019-01-21 14:18:55 +01:00
Max Kellermann 528b4338f4 input/CdioParanoia: use cdio_cddap_free_messages() on recent library versions 2019-01-21 14:16:51 +01:00
Max Kellermann c780b8bba9 input/CdioParanoia: remove useless cdda_messages() call 2019-01-21 12:36:59 +01:00
Max Kellermann ca34f3250b input/CdioParanoia: detect libcdio version at compile time
libcdio_paranoia was split from libcdio in version 90, and at the same
time, the header was moved from cdio/paranoia.h to
cdio/paranoia/paranoia.h.  We can easily detect this version at
compile time which is faster than configure time.
2019-01-21 12:14:13 +01:00
Max Kellermann 008383f24a python/build/libs.py: upgrade CURL to 7.63.0 2019-01-21 10:11:50 +01:00
Jörg Krause 4f7d52dbf2 meson: add fixed-point Vorbis (Tremor) decoder support
Re-add build support for the fixed-point Vorbis (Tremor) decoder, which
was dropped when switching from Autotools to Meson.

Note, that it is not possible to build both, the Vorbis and the Tremor
decoder.

Closes: #405
2019-01-21 08:35:17 +01:00
Max Kellermann c7848da8f2 input/CdioParanoia: add `const` to pointer 2019-01-20 22:03:49 +01:00
Max Kellermann 10a6c5c57d input/CdioParanoia: make variables more local 2019-01-20 21:59:57 +01:00
Max Kellermann 701fd1d939 net/IPv4Address: fix comment typo 2019-01-20 21:05:12 +01:00
Max Kellermann d1bdea8edb Merge branch 'shout_tls' of git://github.com/JakobOvrum/MPD 2019-01-20 21:03:42 +01:00
Jakob Ovrum 0cea67ee70 shout output plugin: add support for TLS 2019-01-19 17:36:14 +01:00
Thomas Klausner 3a0480a482 Add missing include of stdlib.h.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/456
2019-01-15 16:52:40 +01:00
Max Kellermann 1fa99da3c2 net/IPv[46]Address: make the initializers even more portable
Similar to 5a5229b49943c7032d83ae665552b4dc3e334820: use more C++14
constexpr.
2019-01-14 19:21:07 +01:00
James D. Smith 22d669da18 Add APE mapping for album artist.
"De-facto" field mappings are available at http://wiki.hydrogenaud.io/index.php?title=Tag_Mapping.
2019-01-14 19:15:42 +01:00
Thomas Zander 772681f23d Fix link_args for mDNSResponder on non-darwin platforms 2019-01-13 14:09:14 +01:00
Max Kellermann 7ec887eea2 Merge branch 'add-meson-dependencies' of git://github.com/jacobvosmaer/MPD 2019-01-04 19:06:49 +01:00
Max Kellermann 1477b64d4f Merge branch 'patch-2' of git://github.com/HyShai/MPD
Closes #343
2019-01-04 19:04:52 +01:00
Zoltán Mizsei f546e76490 Build fix. This struct is the same on Haiku and on Linux, still gcc
fails on it. This fixes.
2019-01-04 19:01:27 +01:00
Max Kellermann 7104ac963b util/AllocatedArray: import std::swap 2018-12-28 17:18:41 +01:00
Max Kellermann 2cb36590b2 util/AllocatedArray: add `noexcept` 2018-12-28 17:17:28 +01:00
Max Kellermann af7b928d7c output/httpd/Page: remove obsolete API documentation 2018-12-28 17:16:12 +01:00
Max Kellermann c0d8a9b07a output/httpd/Page: add `noexcept` 2018-12-28 17:15:28 +01:00
Max Kellermann 5b0d23d553 output/httpd/IcyMetaDataServer: add `noexcept` 2018-12-28 17:14:27 +01:00
Max Kellermann ab30695bd1 output/httpd: add `noexcept` 2018-12-28 17:06:01 +01:00
Max Kellermann 53a4de35c4 util/DynamicFifoBuffer: add `noexcept` 2018-12-28 17:06:01 +01:00
Max Kellermann 22e6d95c4b remove libwrap support
libwrap is an obscure artefact from a past long ago, when source IP
address meant something.

And its API is "interesting"; it requires the application to expose
two global variables `allow_severity` and `deny_severity`.  This led
to bug #437.  I don't want to declare those variables; instead, I'd
like to remove libwrap support.

Closes #437
2018-12-28 14:16:02 +01:00
Max Kellermann 1c7bd7d5c4 db/update/InotifyQueue: check for ACK_ERROR_UPDATE_ALREADY
Since commit cc64c715a2, UpdateService::Enqueue() throws
ProtocolError(ACK_ERROR_UPDATE_ALREADY) instead of returning 0.
2018-12-28 14:02:41 +01:00
Max Kellermann 3c4ed9cbe3 db/update/InotifyQueue: catch UpdateService::Enqueue() exceptions 2018-12-28 14:00:58 +01:00
Max Kellermann 2677b90244 db/update/InotifyQueue: add `noexcept` 2018-12-28 14:00:55 +01:00
Max Kellermann 1b20fa441d db/update/InotifyQueue: update code comment 2018-12-28 14:00:10 +01:00
HyShai 18c042d4cf
remove non-block call
This is similar to b177bffa6a, in that it fixes the Windows issue of connecting to the open socket. Also, the listen_socket is set to AcceptNonBlock after the connection anyways.
2018-12-18 15:23:40 -05:00
HyShai 76268773b5
change HTTP Version to a valid version 2018-12-14 01:51:54 -05:00
Jacob Vosmaer 87542e3080 Add missing pcre_dep in src/song/meson.build 2018-12-09 17:21:38 +01:00
Jacob Vosmaer 66f5b0fed7 Add boost_dep in subdir meson.build files 2018-12-09 17:20:47 +01:00
Max Kellermann 5cb603983e alsa/NonBlock: throw on snd_pcm_poll_descriptors_revents() error
This function is sparsely documented and a look at the bluez-alsa
source code shows that implementations make undocumented assumptions
on the `struct pollfd` array parameter which can lead to strange
effects.
2018-12-04 18:00:52 +01:00
Max Kellermann 4b7078297d db/upnp: use the generic ::CollectUniqueTags() function
This function implements the "group" feature on top of the
Database::Visit() method.
2018-11-19 20:08:10 +01:00
Max Kellermann 841694ccf2 db/Interface: document CollectUniqueTags() 2018-11-19 19:40:00 +01:00
Max Kellermann 12f4a8255a Main: use DatabasePlugin::RequireStorage() 2018-11-19 19:39:37 +01:00
Max Kellermann bda77ffc5b db/Interface: remove IsPlugin(), use `dynamic_cast` instead 2018-11-19 19:38:20 +01:00
Max Kellermann ed9ece5ea3 db/Interface: make the constructor `protected` 2018-11-19 19:38:20 +01:00
Max Kellermann ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann 2e450bbf95 src/thread/meson.build: detect pthread_setname_np()
This compile-time check got lost during the Meson transition.
2018-11-19 16:33:14 +01:00
Max Kellermann 303b3071e4 db/UniqueTags: remove `pure` attribute because function may throw 2018-11-19 11:32:53 +01:00
Max Kellermann eb6d5f34fc db/UniqueTags: include cleanup 2018-11-19 11:11:45 +01:00
Max Kellermann 4cdcaa8630 output/alsa: don't call snd_pcm_drain() if nothing was written
Works around a problem where MPD goes into a busy loop because
snd_pcm_drain() always returns `-EAGAIN` without making any progress
(fixes #425).

This problem was triggered by snd_pcm_drain() after snd_pcm_cancel()
and snd_pcm_prepare(), but without submitting any data with
snd_pcm_writei().

I believe this is a kernel bug: in non-blocking mode, the kernel's
snd_pcm_drain() function returns early.  In this mode, it only checks
whether snd_pcm_drain_done() has been called already, but
snd_pcm_drain_done() is never called if no data was submitted.

In blocking mode, the following `for` loop detects this condition, so
snd_pcm_drain_done() is not necessary, but without this extra check,
we get `-EAGAIN` forever.
2018-11-16 12:49:37 +01:00
Max Kellermann 436ba3c96c output/alsa: drain the whole `ring_buffer`, not just one period
This fixes a problem which caused a failure with snd_pcm_writei()
because snd_pcm_drain() had already been called in the previous
iteration.  This commit makes sure that snd_pcm_drain() is only called
after the final snd_pcm_writei() call.

This fixes discarded samples at the end of playback.
2018-11-14 13:35:17 +01:00
Max Kellermann 5d12f52873 output/alsa: clear error after reopening device
When a playback error has occurred, MPD would never recover until one
restarts MPD.
2018-11-14 13:20:54 +01:00
Max Kellermann a8bf8ede01 event/Thread: reduce the RTIO timer slack to 10us
MPD's default is 100ms, which is too long for the real-time I/O
thread.  The OutputThread has 100us, but the real-time I/O thread
might have tighter deadlines.

This change has currently no effect (I believe), because nobody uses
timers on the RTIO thread.
2018-11-14 12:11:57 +01:00
Max Kellermann 8682183bc3 LogInit: default to journal if MPD was started as systemd service 2018-11-14 12:07:22 +01:00
Max Kellermann b477f86c92 output/alsa: don't lock the mutex in CancelInternal()
CancelInternal() doesn't need to be protected because it is called
synchronously from Cancel().
2018-11-14 11:50:51 +01:00
Max Kellermann 020371f145 output/alsa: wake up the client thread after generating silence
Fixes a theoretical race condition which could occur in Drain() (but
was extremely unlikely).
2018-11-14 11:48:55 +01:00
Max Kellermann ccafe3f3cf output/alsa: don't generate silence if ALSA-PCM buffer has enough data
If our `ring_buffer` is smaller than the ALSA-PCM buffer (if the
latter has more than the 4 periods we allocate), it can happen that
the start threshold is crossed and ALSA switches to
`SND_PCM_STATE_RUNNING`, but the `ring_buffer` is empty.  In this
case, MPDD will generate silence, even though the ALSA-PCM buffer has
enough data.  This causes stuttering (#420).

This commit amends an older workaround for a similar problem (commit
e08598e7e2) by adding a snd_pcm_avail()
check, and only generate silence if there is less than one period of
data in the ALSA-PCM buffer.

Fixes #420
2018-11-14 11:17:59 +01:00
Max Kellermann 3830748de5 output/alsa: clear the `period_buffer` in LockCaughtError()
The method Cancel() assumes that the `period_buffer` must be empty
when `active==false`, but that is not the case when Play() fails.

Of course the assertion in Cancel() is not 100% correct, but I decided
to rather fix this in LockCaughtError() because the `period_buffer`
should only be accessed from within the RTIO thread, and this is the
only code path where `active` can be set to `false` with a non-empty
`period_buffer`.

Fixes #423
2018-11-14 10:24:08 +01:00
Max Kellermann 1a43f5145d output/alsa: throw on snd_pcm_writei() error while draining
This implements real error handling, and avoids calling
CancelInternal() from this code path.
2018-11-14 10:08:29 +01:00
Max Kellermann 7f143a83c1 output/alsa: fix wrong use of `errno`
alsa-lib doesn't set errno, it returns errors as negative integers.
2018-11-14 10:07:23 +01:00
Max Kellermann 6ccc254179 output/alsa: throw after snd_pcm_drain() error 2018-11-14 10:04:10 +01:00
Max Kellermann 7db2450447 output/alsa: refactor the drain EAGAIN workaround 2018-11-14 10:00:50 +01:00
Max Kellermann 6c2a6a65e0 output/alsa: remove snd_pcm_state() check from DrainInternal()
This check was added 9 years ago in commit
4dc25d3908 to work around a dmix bug
which I assume has been fixed long ago.

Removing this fixes another corner case: if draining is requested
before the start threshold is reached, the PCM is still in
SND_PCM_STATE_PREPARED but not yet SND_PCM_STATE_RUNNING, which means
the submitted data will never be played.  This corner case is
realistic when playing songs shorter than the ALSA buffer (if the
buffer is very large).
2018-11-14 09:48:24 +01:00
Max Kellermann 4247a757b3 output/alsa: call snd_pcm_prepare() if draining is requested early
This fixes a corner case which has probably never occurred and
probably never will: if Cancel() is called, and then Play() followed
by Drain(), the plugin should really play that data.  However
currently, this never happens, because snd_pcm_prepare() is never
called.
2018-11-14 09:43:14 +01:00
Max Kellermann 060908d5c4 song/Filter: add operator "contains"
Closes #410
2018-11-12 12:49:01 +01:00
Max Kellermann 228bf7eb09 output/thread: cancel the AudioOutputSource() instead of closing it
This fixes the assertion failure due to calling
AudioOutputSource::Close() twice.
2018-11-12 12:24:25 +01:00
Max Kellermann 5eaf2b8fc3 output/control: always close the `AudioOutputSource` in `RELEASE`
Fixes a crash bug with `always_on` outputs which occurs because the
`AudioOutputSource` still has a pointer to an outdated `MusicChunk`.

Fixes #415
2018-11-12 12:21:59 +01:00
Max Kellermann e097fef79e output/control: add command `RELEASE`
With the new command, the decision to pause or close the output moves
into the output thread.
2018-11-12 12:09:37 +01:00
Max Kellermann 9a813cd3b1 output/Thread: update comment 2018-11-12 12:09:02 +01:00
Max Kellermann 1c60c8e014 output/Filtered: catch Drain() exceptions in CloseOutput() 2018-11-12 12:05:54 +01:00
Max Kellermann eddda95900 output/interface: document that Drain() may throw 2018-11-12 12:04:42 +01:00
Max Kellermann 72184dccfc song/StringFilter: support regular expressions with "=~" and "!~"
This feature requires `libpcre`.
2018-11-11 12:55:35 +01:00
Max Kellermann fee75dc766 {output,mixer}/alsa: use snd_pcm_poll_descriptors_revents()
This call was missing, causing very high CPU usage when the ALSA
output plugin was used with dmix.

Closes #391
2018-11-11 12:37:29 +01:00
Max Kellermann ba5c856f15 events/MultiSocketMonitor: add method ForEachResult() 2018-11-11 12:37:28 +01:00
Max Kellermann 12308a0f55 lib/alsa/NonBlock: move the functions into a class managing the state 2018-11-11 12:37:25 +01:00
Max Kellermann a958abde2f Merge branch 'fix_362' of git://github.com/miccoli/MPD 2018-11-11 12:37:13 +01:00
Max Kellermann 583208db7e output/httpd: fix nullptr dereference crash bug
When `metadata_sent` is `false`, the plugin assumes there is metadata
which must be sent, even if no metadata page was passed to the plugin.
Initializing it to `true` avoids dereferencing this `nullptr`.

Fixes #412
2018-11-08 09:37:18 +01:00
Max Kellermann 7b5ba15170 song/Filter: move code to ParseStringFilter() 2018-11-08 00:02:10 +01:00
Max Kellermann d5e0d49f86 song/{Tag,Uri}SongFilter: pass `StringFilter&&` to constructor 2018-11-07 23:57:42 +01:00
Max Kellermann 73b22d82aa song/StringFilter: move `negated` flag from containing class 2018-11-07 23:47:31 +01:00
Max Kellermann db51cc4e02 lib/zlib/meson.build: add zlib_dep to `declare_dependency`
Fixes potential compiler error when zlib is installed in a
non-standard directory.
2018-11-07 23:32:23 +01:00
Max Kellermann ad597a8ff0 lib/zlib/meson.build: define ENABLE_ZLIB
Fixes #414
2018-11-07 23:24:58 +01:00
Max Kellermann b1fe105904 output/Source: reset current_chunk in Open()
If the output is already open, the `current_chunk` pointer may be
bogus and out of sync with `SharedPipeConsumer::chunk`, leading to an
assertion failure in `SharedPipeConsumer::Consume()`.

Fixes #411
2018-11-07 00:17:48 +01:00
Max Kellermann 451b142e3a player/Thread: finish decoder startup before checking the buffer
This fixes a valgrind warning because `buffer_before_play`
initialization needs to know the audio format from the decoder.
2018-11-06 23:52:26 +01:00
Max Kellermann 98985c03b0 check.h: remove obsolete ENABLE_LARGEFILE check
Meson always enables large file support on the compiler command line,
thus config.h doesn't need to be included anymore.  We'll remove the
whole `check.h` header soon.

Closes #409
2018-11-05 21:25:59 +01:00
Max Kellermann 793fd8c479 decoder/ffmpeg: eliminate GetSampleFormat() 2018-11-04 22:36:17 +01:00
Max Kellermann 6c602811df decoder/ffmepg: fill AudioFormat from AVCodecContext, not AVCodecParameters
`AVCodecParameters` contains values from the codec detected by
avformat_find_stream_info(), but after avcodec_open2(), a different
codec might be selected with a different `AVSampleFormat`.  This leads
to misinterpretation of data returned from FFmpeg, leading to random
noise or silence.

This was observed with FFmpeg 4.0.2 and a TS container file containing
MP2.  A mp3-float codec was detected returning `AV_SAMPLE_FMT_FLTP`,
but finally the `mpegaudiodec_fixed.c` was used, returning
`AV_SAMPLE_FMT_S16`.

By using the audio format from `AVCodecContext`, we ensure that MPD
and FFmpeg always agree on the actual audio format in the buffer.

This removes the FFmpeg bug workaround from commit e1b032cbad which I
assume is obsolete after 7 years.

Fixes #380
2018-11-04 22:30:50 +01:00
Stefano Miccoli 6d48a5684a clamp 'set_normalized_volume' to valid values also for ALSA softvol
ensure that valid mixer values are set also when the ALSA driver
does not report a valid dB range ('set_raw' fallback)

correct a bug in which volume is assumed to lie in [0..100]
instead of [0..1]
2018-11-04 22:21:56 +01:00
Max Kellermann bd115a4008 decoder/ffmpeg: use AtScopeExit() to call av_packet_unref() 2018-11-04 22:01:33 +01:00
Max Kellermann 08272cdee2 decoder/ffmpeg: require FFmpeg 3.1 or later
Drop some compatibility code.
2018-11-04 21:55:06 +01:00
Max Kellermann ac0852b4e3 song/Filter: operator "==" never searches substrings in filter expressions
The protocol documentation says that the difference between `find` and
`search` is that `search` is case insensitive, but that's only half
the truth: `search` also searches for sub strings instead of matching
the whole string.  This part is undocumented and unfortunate, but at
this point, we can't change it.

However leaking this surprising behavior to the new filter expressions
was a bad idea; the "==" operator should never match substrings.  For
people who need that, we should add a new operator.
2018-11-04 13:57:34 +01:00
Max Kellermann 6fe43ed969 song/StringFilter: add flag `substring`
Prepare to stop using substrings for filter expressions.
2018-11-04 13:49:47 +01:00
Max Kellermann b34bc06624 song/StringFilter: use std::string::operator== 2018-11-04 13:49:38 +01:00
Max Kellermann 86f1074905 lib/xiph/meson.build: the Vorbis encoder requires the Vorbis decoder
Without the Vorbis decoder, `libvorbis` is never detected, leading to
linker failures when attempting to build the Vorbis encoder.
2018-11-04 12:21:23 +01:00
Max Kellermann 6f242836e6 lib/xiph/meson.build: fix typo, replace `and` with `or`
Fixes linker failure when building without FLAC support.

Closes #400
2018-11-04 11:36:28 +01:00
Max Kellermann f2c926f3b6 zeroconf/glue: add fallback value for HOST_NAME_MAX
`HOST_NAME_MAX` is not a portable macro; it is undefined on some
systems.

Closes #402
2018-11-04 11:12:03 +01:00
Max Kellermann 528f5b9cb9 song/Filter: allow escaping quotes in filter expressions
Closes #397
2018-11-02 19:15:08 +01:00
Max Kellermann 5a5229b499 net/IPv[46]Address: make the initializers more portable
Thanks to C++14, we can declare and fill variables inside `constexpr`
functions.  This means me can stop make assumptions on the `struct`
layouts without losing `constexpr`.

Closes #393
2018-11-02 17:47:43 +01:00
Max Kellermann bba22c9c8c system/FileDescriptor: check `__linux__` instead of `__linux`
`__linux` is the deprecated non-standard macros which appears to be
not present at all on PowerPC.

Closes #398
2018-11-02 16:50:38 +01:00
Max Kellermann 2a926063b2 src/lib/ffmpeg/meson.build: copy dependencies into ffmpeg_dep
Apparently, Meson propagates the linker flags but not the compiler
flags from a `static_library`'s dependencies list.

Closes #392
2018-11-01 19:14:00 +01:00
Max Kellermann 657ef48518 zeroconf/glue: use strstr() and std::string::replace() instead of std::regex_replace()
std::regex_replace() is heavily bloated and overkill for this feature.
2018-10-31 19:26:37 +01:00
Max Kellermann 8a492c8f39 Merge branch 'bug516974' of git://github.com/fschlich/MPD 2018-10-31 19:20:41 +01:00
Max Kellermann 901a48c9a4 command/sticker: return ACK_ERROR_NO_EXIST for "no such sticker"
Closes #389
2018-10-31 19:19:07 +01:00
Max Kellermann f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Florian Schlichting d1f85240a2 include hostname in zeroconf_name (fixes #387)
expand %h to the system hostname and default to a zeroconf string that
contains %h
2018-10-31 17:54:45 +01:00
Max Kellermann 2148d4bb31 fs/io/FileOutputStream: fix -Wcomment 2018-10-31 17:18:44 +01:00
Max Kellermann e79d06d595 fs/io/FileOutputStream: don't use O_TMPFILE on Android
Fixes writing to Context.getCacheDir().
2018-10-31 17:12:21 +01:00
Max Kellermann c60cf944f5 fs/io/FileOutputStream: add macro HAVE_O_TMPFILE 2018-10-31 17:10:52 +01:00
Max Kellermann 06ca08ce55 output/roar: remove
Bugs in libroar which broke the MPD build have been annoying me for
quite some time, and the newest bug has now hit my main build machine:

 https://github.com/MusicPlayerDaemon/MPD/issues/377

Problem is the usage of the typedef `_IO_off64_t` in libroar's
`vio_stdio.h`:

 int roar_vio_to_stdio_lseek (void *__cookie, _IO_off64_t *__pos, int __w);

This `_IO_off64_t` is an internal implementation detail of glibc and
was removed in version 2.28.  Nobody must ever use it.  Why the ****
did the RoarAudio developers use it?  Not using internal typedefs
isn't exactly rocket science.

This annoys me enough to finally remove the plugin.  Anyway, I've
never heard of anybody using RoarAudio, so my best guess is that
nobody will notice.
2018-10-31 15:03:28 +01:00
Max Kellermann 9fc00a817b Listen: use fs/XDG.hxx
This keeps one central place for the XDG switch.  Specifically, this
disables the XDG listener on Apple, where XDG is not supported.
2018-10-31 14:30:34 +01:00
Max Kellermann f47696f5f8 fs/StandardDirectory: move USE_XDG to XDG.hxx 2018-10-31 13:39:20 +01:00
Florian Schlichting db21d7de0b fix compilation errors on Debian GNU/Hurd
Apparently on hurd-i386 __GLIBC__ is defined, but the pthread
implementation is special and cannot be used with constexpr. Hence
exclude __gnu_hurd__.
2018-10-31 12:24:34 +01:00
Max Kellermann 56112a237c Listen: listen on $XDG_RUNTIME_DIR/mpd/socket by default 2018-10-30 22:14:54 +01:00
Max Kellermann 64da9399ca event/ServerSocket: allow mixing AddFD() with other Add*() methods 2018-10-30 22:14:53 +01:00
Max Kellermann 0ec31b4aa4 Listen: eliminate listen_add_config_param() 2018-10-30 21:14:39 +01:00
Max Kellermann a943f4063c event/ServerSocket: add AddFD() overload with AllocatedSocketAddress&& 2018-10-30 20:44:56 +01:00
Max Kellermann ce9f09c69a event/ServerSocket: make AddAddress() a template 2018-10-30 20:43:52 +01:00
Max Kellermann 3ddc7a5353 event/ServerSocket: include cleanup 2018-10-30 20:19:07 +01:00
Max Kellermann e575392b94 event/ServerSocket: use class IPv6Address 2018-10-30 20:19:04 +01:00
Max Kellermann c6f61a699c event/ServerSocket: make OneServerSocket an inner class 2018-10-30 20:16:26 +01:00
Max Kellermann 0307b49f43 event/ServerSocket: make OnAccept() noexcept 2018-10-30 20:13:07 +01:00
Max Kellermann 413ab80295 event/ServerSocket: use C++11 initializer 2018-10-30 20:11:58 +01:00
Max Kellermann daffefdb10 event/ServerSocket: pass UniqueSocketDescriptor to AddFD() 2018-10-30 20:05:57 +01:00
Max Kellermann 5fb21fbdb1 event/ServerSocket: add `noexcept` 2018-10-30 19:57:39 +01:00