Commit Graph

1698 Commits

Author SHA1 Message Date
Max Kellermann 92495d2b0b decoder/mpcdec: fix bogus ReplayGain values
Apparently, libmpcdec sets gain/peak variables to zero if they are not
present.  This clashes with our formula and results in bogus values
which cause noise during playback.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/640
2019-09-13 19:52:11 +02:00
Max Kellermann 5ef645df97 NEWS: add missing line for 818b7e0641 2019-09-08 12:54:16 +02:00
Max Kellermann 0da9c91af2 decoder/{dsf,dsdiff}: fix displayed bit rate
The formula did not consider the channel count.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/639
2019-09-08 12:45:05 +02:00
Max Kellermann e70f40fac1 increment version number to 0.21.15 2019-08-22 11:40:17 +02:00
Max Kellermann bc89ca92b4 release v0.21.14 2019-08-21 10:47:53 +02:00
Max Kellermann 6c9f9c136b command/all: don't create new Response instance in exception handler
The new Response instance in the `catch` block didn't have the
`command` attribute set, so the error response didn't indicate which
command had failed, which however is required in the MPD protocol.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/628
2019-08-20 20:31:36 +02:00
Max Kellermann 44444e1b89 decoder/Thread: on late SEEK, start decoder at seek position
Previously, a bogus value (whatever happened to be still in
`start_time`) was used.
2019-08-20 20:15:08 +02:00
Max Kellermann ca450663d0 decoder/Control: work around crash after SEEK was too late
See code comment.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/629
2019-08-20 20:01:53 +02:00
Fredrik Noring 2d61e526de decoder/sidplay: Fix date field to have year but not company or author
Field 2 is called <released>, formerly used as <copyright>[1][2]. It is
formatted <year><space><company or author or group>, where <year> may be
<YYYY>, <YYY?>, <YY??> or <YYYY-YY>, for example "1987", "199?", "19??"
or "1985-87". The <company or author or group> may be for example Rob
Hubbard. A full field may be for example "1987 Rob Hubbard".

This change splits the <released> field at the first <space>, to retain
the <year> part.

The 51823 SID files in High Voltage SID Collection (HVSC) version 71
have the following distribution of dates:

    333 19??         11 1990-92       6 1995-99       2 2006-08
    827 198?         88 1990-93    2140 1996        530 2007
     32 1982         69 1990-94       9 1996-97      15 2007-08
      1 1982-83      49 1990-95       2 1996-98       2 2007-09
    255 1983       3467 1991          5 1996-99       1 2007-10
    677 1984         75 1991-92    1840 1997        430 2008
    775 1985         65 1991-93       4 1997-98      23 2008-09
      3 1985-86      10 1991-94    1276 1998          1 2008-12
     10 1985-87      35 1991-97       4 1998-99     631 2009
    943 1986       3320 1992        865 1999          1 2009-10
     12 1986-87      26 1992-93      24 200?        645 2010
      5 1986-89      59 1992-94     590 2000          1 2010-12
   2083 1987          1 1992-96       4 2000-01     538 2011
     31 1987-88    2996 1993        727 2001          1 2011-12
     44 1987-89      42 1993-94     875 2002        651 2012
   2510 1988         12 1993-95       2 2002-04     811 2013
    129 1988-89       2 1993-97     844 2003        790 2014
     91 1988-90    2737 1994          3 2003-05     740 2015
     58 1988-91      16 1994-95     842 2004        792 2016
   3466 1989         20 1994-96       2 2004-05     775 2017
     95 1989-90      17 1994-97     707 2005        638 2018
    150 1989-91    2271 1995          1 2005-06     284 2019
   1077 199?          2 1995-96       2 2005-07
   2834 1990          4 1995-97     785 2006
    119 1990-91       2 1995-98       6 2006-07

References:

[1] https://www.hvsc.c64.org/download/C64Music/DOCUMENTS/SID_file_format.txt
[2] https://hvsc.c64.org/info
2019-08-10 10:50:51 +02:00
Fredrik Noring 7723c481db decoder/sidplay: Fix windows-1252 to utf-8 string conversion
High Voltage SID Collection (HVSC) metadata fields are encoded in
windows-1252, as described in DOCUMENTS/SID_file_format.txt:

https://www.hvsc.c64.org/download/C64Music/DOCUMENTS/SID_file_format.txt

If utf-8 transcoding fails, or the ICU library is unavailable, fall
back to plain ASCII and replace other characters with '?'.
2019-08-10 10:45:02 +02:00
Fredrik Noring 0ed10542cc decoder/sidplay: Fix song length initialisation during container scan
The song length was previously undetermined.
2019-08-09 15:39:36 +02:00
Max Kellermann ab830f9afd increment version number to 0.21.14 2019-08-09 15:38:01 +02:00
Max Kellermann d4d2bc072e release v0.21.13 2019-08-06 11:35:42 +02:00
Max Kellermann bcccc8f66c output/jack: use jack_free() for Windows compatibility 2019-08-06 11:34:56 +02:00
Max Kellermann 3ef043392c input/cdio_paranoia: drop support for libcdio-paranoia older than 10.2+0.93+1
Version 10.2+0.93+1 was released five years ago in 2014 and is the
first version to feature cdio_cddap_free_messages().  There is no way
to check the libcdio-paranoia version at compile time, so let's just
remove support for older versions instead of attempting to fix the
cdio_cddap_free_messages() check at build time.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/613
2019-08-06 11:09:36 +02:00
Max Kellermann 864d6f312d Revert "decoder/mad: use MAD_F_MIN and MAD_F_MAX"
This reverts commit f7ed7446ae.  It was
a bad idea, because MAD_F_MIN and MAD_F_MAX do not represent the
clamping limits, but the theoretical minimum and maximum values of the
mad_fixed_t data type.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/617
2019-08-05 13:07:41 +02:00
Max Kellermann f44c67de09 increment version number to 0.21.13 2019-08-05 13:05:54 +02:00
Max Kellermann ae19bda1f2 release v0.21.12 2019-08-03 12:48:20 +02:00
Max Kellermann f2d8fd769d player/Thread: don't restart unseekable song after failed seek attempt
The check IsSeekableCurrentSong() was added by commit
44b200240f in version 0.20.19, but it
caused a regression: by doing the branch only if the current song is
seekable, the player would restart the current song if it was not
seekable, and later the initial seek would fail; but we already know
it's not seekable, and so we should fail early.
2019-08-03 12:30:10 +02:00
Max Kellermann 952c793235 decoder/mad: subtract libmad decoder delay from LAME encoder padding
Apparently, libmad not only inserts 529 samples of silence at the
beginning of the file, but also removes them at the end.

This solves the last piece of
https://github.com/MusicPlayerDaemon/MPD/issues/601

Closes https://github.com/MusicPlayerDaemon/MPD/issues/601
2019-08-03 08:35:00 +02:00
Max Kellermann a0a74951b8 decoder/mad: eliminate attribute "bit_rate"
This also fixes a bug which caused the bit rate to not update after
seeking.
2019-08-03 00:38:45 +02:00
Diomendius b81138bda1 Fix JACK plugin outputting only to left channel
The JACK output plugin would not correctly upmix mono input files when exactly 2 output ports were configured. This fixes that.
2019-08-02 15:52:20 +02:00
Max Kellermann 6de088140b lib/xiph/OggVisitor: invoke OnOggPacket() with the "E_O_S" packet
The "end of stream" packet is not special; it contains normal data,
and thus we should pass it to OnOggPacket().

This fixes one part of https://github.com/MusicPlayerDaemon/MPD/issues/601
2019-08-02 14:04:08 +02:00
Max Kellermann b955334882 decoder/opus: ignore case in replay gain tag names
Closes https://github.com/MusicPlayerDaemon/MPD/issues/604
2019-07-29 10:40:37 +02:00
Max Kellermann 90ea3bf985 playlist/Song: support backslash in relative URIs
Closes https://github.com/MusicPlayerDaemon/MPD/issues/607
2019-07-29 09:58:53 +02:00
Max Kellermann 39b302dcad increment version number to 0.21.12 2019-07-12 17:22:20 +02:00
Max Kellermann f6125f0c35 release v0.21.11 2019-07-03 15:16:27 +02:00
Max Kellermann f780ac418a output/alsa: log when generating silence due to slow decoder
MPD used to do that when this code lived in the player thread, but it
was removed by commit 98a7c62d7a4f716d90af6d78e18d1a3b10bc54b3; and
the replacement code in the ALSA output plugin didn't have it.
2019-06-28 18:15:30 +02:00
Max Kellermann 61a72a5d13 output/alsa: schedule a timer to generate silence
Without this timer, DispatchSockets() may disable the
MultiSocketMonitor and if Play() doesn't get called soon, it never
gets a chance to generate silence.  However if Play() gets called,
generating silence isn't necessary anymore...

Resulting from this misdesign (added by commit ccafe3f3cf in 0.21.3),
the silence generator didn't work reliably.
2019-06-28 18:04:49 +02:00
Max Kellermann c926021599 output/alsa: always redo DrainInternal() after writing
Draining isn't finished just because the period_buffer has run empty.
It is only finished after snd_pcm_drain() has succeeded.
2019-06-28 09:10:16 +02:00
Max Kellermann 543776d9c9 output/alsa: check PCM state before calling snd_pcm_drain()
Apparently, if snd_pcm_drain() returns EAGAIN, it does not actually
want to be called again; the next call will snd_pcm_drain() will also
return EAGAIN, forever, even though the PCM state has meanwhile
switched to SND_PCM_STATE_SETUP.  This causes a busy loop; to fix
this, we should always check snd_pcm_state() to see if draining is
really required.
2019-06-28 08:55:25 +02:00
Max Kellermann 8bf3f9b874 input/tidal: deprecated because Tidal has changed the protocol
See https://github.com/MusicPlayerDaemon/MPD/issues/545
2019-06-26 23:14:07 +02:00
Max Kellermann ea639269d8 decoder/wildmidi: throw PluginUnavailable on WildMidi_Init() error
Closes https://github.com/MusicPlayerDaemon/MPD/issues/589
2019-06-26 22:40:27 +02:00
Max Kellermann 2c3eeb7194 MusicChunk: pad MusicChunkInfo to a multiple of 8 bytes
Workaround for a regression caused by commit
a06bf388d9, revealing a problem with
discarding odd numer of frames in the DSD_U32 and DoP converters,
causing distortions with DSD_U32 and DoP on 32 bit CPUs.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/469
2019-06-17 21:24:32 +02:00
Max Kellermann 1eae9339f2 db/Interface: CollectUniqueTags() allows multiple "groups"
Instead of passing tag and group, pass an array of tags.  To support a
nested return value, return a nested std::map of std::maps.  Each key
specifies the tag value, and each value may be another nesting level.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/408
2019-06-16 10:39:29 +02:00
Max Kellermann 09884e608b increment version number to 0.21.11 2019-06-11 09:29:05 +02:00
Max Kellermann e239009295 release v0.21.10 2019-06-05 22:32:32 +02:00
Max Kellermann 3fae2150f5 decoder/OpusReader: return StringView
Since we now don't duplicate all items, we can easily remove the 64kB
limit from OpusReader::ReadString() and instead silently ignore and
skip all strings which are longer than 4 kB.

This fixes a tag duplication bug with Opus file containing a very long
`METADATA_BLOCK_PICTURE` tag, which occurred because the Opus plugin
returned false after parsing all tags, and then the MPD core fell back
to FFmpeg which scanned the tags again.
2019-06-05 22:19:35 +02:00
cathugger f9ca2f52c1 output/httpd: reject some well-known request paths
Return `404 not found` for some common well-known paths, as clients requesting them usually do that automatically and don't expect endless audio stram.

Closes #572
2019-06-05 21:53:46 +02:00
Max Kellermann 304d45b551 Revert "player/Thread: remove unnecessary "pipe" check"
This reverts commit ff3e2c0514.  The
check was necessary, after all, because this is what checked whether
the decoder had finished the current or the next song.

> The "queued" flag can only possibly be set if the decoder is still
> decoding the current song or if the decoder is stopped.

That was wrong because ProcessCommand() sets `queued=true` and also
starts the decoder (if it was idle).

> This is also what the following assert() checks.

That was also wrong, because the assert() has two conditions.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/566
2019-05-31 17:23:12 +02:00
Max Kellermann 03507037e8 increment version number to 0.21.10 2019-05-31 16:16:56 +02:00
Max Kellermann 66a8fac25e release v0.21.9 2019-05-20 17:10:58 +02:00
Max Kellermann 923e66738c player/Thread: fix "single" mode race condition
If the decoder finishes decoding the current song between the two
IsIdle() checks, MPD stops playback instead of starting the decoder
for the next song.

This is usually not visible problem, because the main thread restarts
it via playlist::ResumePlayback(), but that way it, ignores "single"
mode.

As a workaround, this commit adds another "queued" check which
re-enters the player loop and checks again whether to start the
decoder.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/556
2019-05-20 16:22:01 +02:00
Max Kellermann ca06d9d3bf input/buffered: fix deadlock bug 2019-05-16 21:11:03 +02:00
Max Kellermann 65df6ca14e android/Settings: request READ_EXTERNAL_STORAGE permission
Using this API function requires SDK level 23.
2019-05-04 07:29:41 +02:00
Max Kellermann 36dec47bf7 android/build.py: link ARMv7 binary with libunwind
Fixes nullptr dereference when an exception gets thrown because there
is no ".eh_frame" section for unwinding.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/543
2019-05-03 20:15:50 +02:00
Max Kellermann 478cedcadf increment version number to 0.21.9 2019-05-03 20:15:33 +02:00
Max Kellermann cabcbb059d release v0.21.8 2019-04-23 14:35:14 +02:00
Max Kellermann 5e21b2db3c doc/protocol.rst: "list file" is deprecated
Closes https://github.com/MusicPlayerDaemon/MPD/issues/526
2019-04-23 14:29:42 +02:00
Max Kellermann 3a0d6d96c1 input/smbclient: wrap in MaybeBufferedInputStream
This enables the input buffer for remote files and caches file
contents in MPD.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/376
2019-04-23 14:08:27 +02:00
Max Kellermann ead3dc6a92 LocateUri: pass URI plugin kind, optionally disables plugin verify
Commit b3a458338a added a LocateUri()
call to several playlist commands, which applied InputPlugin URI
scheme verification to playlist URIs.  This broke the SoundCloud
playlist plugin which uses "soundcloud://" URIs for which no input
plugin exists.

This commit allows the caller to specify the kind of plugin which
shall be used to verify the URI.  Right now, only "input" is
implemented; "storage" uses the "input" verification for now; and
"playlist" has no verification at all (for now).

Closes https://github.com/MusicPlayerDaemon/MPD/issues/528
2019-04-18 10:03:15 +02:00
Eugene Gorodinsky 8d18b4c24b Fix meson.build to work properly with '-Ddatabase=false' 2019-04-18 08:55:13 +02:00
Max Kellermann fe8621906d systemd: add user socket unit
Copy the system socket unit to the "user" directory.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/530
2019-04-10 16:37:13 +02:00
Max Kellermann f6941f9a44 event/SocketMonitor: don't cancel if OnSocketReady() returns false
Expect OnSocketReady() to cancel events.  If it returns false, the
SocketMonitor may be destructed already.  This fixes a use-after-free
bug in the "httpd" output plugin.
2019-04-04 10:24:58 +02:00
Max Kellermann df33a898d7 zeroconf/Bonjour: fix OnSocketReady() return value
Keep the SocketMonitor registered.  This wrong return value was added
6 years ago in commit 72cf8dd8a0, andd
apparently, nobody ever noticed.
2019-04-04 10:24:29 +02:00
Max Kellermann 380656d8c9 output/httpd: add missing mutex lock 2019-04-03 22:53:03 +02:00
Max Kellermann 37b54179d8 net/IPv[46]Address: add cast to void* to fix GCC9 build failure
Fixes:

 src/net/IPv4Address.hxx: In member function 'constexpr IPv4Address::operator SocketAddress() const':
 src/net/IPv4Address.hxx:171:24: error: a reinterpret_cast is not a constant expression
   171 |   return SocketAddress((const struct sockaddr *)&address,
       |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 src/net/IPv6Address.hxx: In member function 'constexpr IPv6Address::operator SocketAddress() const':
 src/net/IPv6Address.hxx:138:24: error: a reinterpret_cast is not a constant expression
   138 |   return SocketAddress((const struct sockaddr *)&address,
       |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Closes https://github.com/MusicPlayerDaemon/MPD/issues/522
2019-04-03 16:59:53 +02:00
Max Kellermann 511826763a increment version number to 0.21.8 2019-04-03 12:27:18 +02:00
Max Kellermann ef10354d06 release v0.21.7 2019-04-03 12:18:29 +02:00
Max Kellermann 976731ab6c command/playlist: invoke the RemoteTagScanner on all newly added songs
Closes https://github.com/MusicPlayerDaemon/MPD/issues/234
2019-03-29 17:01:31 +01:00
François Revol 37a0f04712 Haiku: add version info to the resources like win32 does 2019-03-29 14:33:27 +01:00
François Revol 9d0bf5e95c Haiku: fix build 2019-03-29 14:32:06 +01:00
Max Kellermann 8fc3c5c612 event/ServerSocket: add HAVE_UN check to AddAbstract()
Closes https://github.com/MusicPlayerDaemon/MPD/issues/510
2019-03-20 13:06:09 +01:00
Jörg Krause c66389a453 meson.build: require Meson 0.49.0
Meson 0.49.0 adds native support for `libgcrypt-config` which is
necessary for detecting libgcrypt dependencies, as the latest
version 1.8.4 of libgcrypt does not provide a .pc file.
2019-03-18 09:11:46 +01:00
Max Kellermann b63c1a2144 increment version number to 0.21.7 2019-03-18 09:11:16 +01:00
Max Kellermann 808dd7cc54 release v0.21.6 2019-03-17 23:52:13 +01:00
Max Kellermann 62a129c18f PlaylistFile: ignore empty playlist names
Closes https://github.com/MusicPlayerDaemon/MPD/issues/465 and
https://github.com/MusicPlayerDaemon/MPD/pull/466
2019-03-17 23:46:36 +01:00
Max Kellermann c18cd941aa lib/xiph: disable Tremor detection if libvorbis was found
And disable libvorbis detection if Tremor was explicitly enabled.

This fixes a crash bug caused by libvorbis/Tremor ABI conflict caused
by commit 4f7d52dbf2
2019-03-17 23:36:52 +01:00
Max Kellermann 6d12c22653 decoder/ogg: ignore the BOS packet after seek to the beginning of song
Previously, MPD would skip the current song after attempting to seek
to its beginnig, because that was a seek to offset 0.  At offset 0,
MPD will see the BOS packet again, which results in throwing
StopDecoder in MPDOpusDecoder::OnOggEnd().

Closes https://github.com/MusicPlayerDaemon/MPD/issues/470
2019-03-17 23:14:59 +01:00
Max Kellermann b76d78e6ae output/sles: enable power saving mode 2019-03-17 18:04:40 +01:00
Jacob Vosmaer 0a6e484b1a output/plugins/OSXOutputPlugin: add boost meson dependency 2019-03-17 16:59:24 +01:00
Max Kellermann 0bb71f1f20 output/pulse: use pa_channel_map_init_extend() instead of _auto()
Unlike pa_channel_map_init_auto(), pa_channel_map_init_extend() does
not fail if there is no valid mapping for the given channel count, but
instead maps additional "AUX" channels.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/493
2019-03-16 14:03:10 +01:00
Max Kellermann 1aa7cdd602 decoder/opus: fix replay gain when there are no other tags
The `tag_builder.empty()` check was wrong for the SubmitReplayGain()
call.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/497
2019-03-16 13:55:19 +01:00
Max Kellermann 3bf521d5ca song/TagSongFilter: apply negation properly to multiple tag values
The old implementation didn't make a lot of sense; the "!=" operator
was not actually the opposite of "==".

Closes https://github.com/MusicPlayerDaemon/MPD/issues/505
2019-03-16 13:23:02 +01:00
Max Kellermann 98b29f6d1c meson.build: remove the libwinpthread-1.dll dependency on Windows
Closes https://github.com/MusicPlayerDaemon/MPD/issues/507
2019-03-14 20:07:06 +01:00
Max Kellermann 59fdfd25cb command/database: fix "list" with filter expression
Disable the 0.11 compatibility mode if the only argument is a filter
expression.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/506
2019-03-14 19:50:09 +01:00
Max Kellermann 0d98677212 playlist/flac: copy the URI to fix use-after-free bug
Closes https://github.com/MusicPlayerDaemon/MPD/issues/508
2019-03-14 19:30:33 +01:00
Max Kellermann 713c1f2ba9 Merge branch 'feature/playlist' of git://github.com/miccoli/MPD 2019-02-27 13:49:22 +01:00
Max Kellermann 44422b2b2f event/ServerSocket, config/Net: abstract socket support 2019-02-25 13:08:33 +01:00
Max Kellermann f10afd38b5 NEWS: mention the cdio_paranoia build failure fix 2019-02-25 13:08:33 +01:00
Max Kellermann f255a485b7 increment version number to 0.21.6 2019-02-22 15:28:03 +01:00
Max Kellermann 1930d5774d release v0.21.5 2019-02-22 15:23:33 +01:00
Max Kellermann 30e0644722 db/simple: call ReturnSong() on mounted database
Fixes a memory leak, or an assertion failure in the debug build.
2019-02-22 14:52:13 +01:00
Max Kellermann d5983dd362 storage/udisks2: use the relative path
Closes #487
2019-02-22 14:41:56 +01:00
Max Kellermann 8002bc752f NEWS: mention the udisks2 AlreadyMounted fix 2019-02-22 14:41:56 +01:00
Max Kellermann b59f37bc0a db/simple/Directory: close the Database in destructor
Fixes assertion failure.
2019-02-20 22:50:15 +01:00
Max Kellermann cf2d171ccc db/simple: reorder checks in assert() to fix assertion failure
`light_song.Get()` could cause an assertion failure because the
`Manual<>` object must not be used if uninitialized.

Regression by commit ebc006ab52
2019-02-20 21:24:01 +01:00
Max Kellermann d9c3215584 mixer/pulse: rename `scale` to `scale_volume`
Make it less generic, to avoid clashes.
2019-02-20 19:23:11 +01:00
Max Kellermann 674c137e5f NEWS: mention the TagMask typo fix 2019-02-02 15:17:25 +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 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 d1bdea8edb Merge branch 'shout_tls' of git://github.com/JakobOvrum/MPD 2019-01-20 21:03:42 +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
Max Kellermann 1862a98a44 increment version number to 0.21.5 2019-01-04 19:31:07 +01:00
Max Kellermann 4634b94c83 release v0.21.4 2019-01-04 19:22:21 +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
Max Kellermann a2c108f5ef NEWS: mention the Haiku build fix 2019-01-04 19:03:53 +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 3c4ed9cbe3 db/update/InotifyQueue: catch UpdateService::Enqueue() exceptions 2018-12-28 14:00:58 +01:00
Max Kellermann 98f92d828a NEWS: mention the "ICY" -> "HTTP/1.1" change 2018-12-14 09:26:59 +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 4fb4f6d1b7 increment version number to 0.21.4 2018-11-19 09:58:05 +01:00
Max Kellermann 43df4a7500 release v0.21.3 2018-11-16 13:27:58 +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 8682183bc3 LogInit: default to journal if MPD was started as systemd service 2018-11-14 12:07:22 +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 57e34823d8 increment version number to 0.21.3 2018-11-12 13:59:17 +01:00
Max Kellermann 3c93decdf0 release v0.21.2 2018-11-12 13:33:04 +01:00
Max Kellermann 060908d5c4 song/Filter: add operator "contains"
Closes #410
2018-11-12 12:49:01 +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 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 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 be8a52a914 NEWS: mention the ENABLE_ZLIB fix 2018-11-07 23:26:33 +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 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
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 b14a5141a6 increment version number to 0.21.2 2018-11-04 19:47:04 +01:00
Max Kellermann aa0e4500c6 release v0.21.1 2018-11-04 14:08:16 +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 08e41e60e5 meson.build: downgrade Boost 1.67 error to warning
Some Boost 1.67 packages apparently have a workaround for the bug, so
let them build MPD.
2018-11-04 12:45:22 +01:00
Max Kellermann 10ec478a9c meson.build: refuse to build with buggy Boost version 1.67 2018-11-04 12:31:49 +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 e3bc85d7bf meson.build: require Meson 0.47.2
Meson 0.47.1 suffers from a bug which breaks linking the MPD
executable because the `-lpthread` flag is not propagated from our
`thread.a`.

See https://github.com/mesonbuild/meson/pull/3895

Closes #403
2018-11-04 11:54:40 +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 aba18924ee win32/build.py: link libstdc++ and libcc statically
Fixes #404
2018-11-04 11:10:00 +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 694c437a2c NEWS: mention the FFmpeg build fix 2018-11-02 16:50:35 +01:00
Max Kellermann b8989fafeb increment version number to 0.21.1 2018-11-01 17:23:47 +01:00
Max Kellermann 795789e79d release v0.21 2018-10-31 19:39:53 +01:00
Max Kellermann b1d68fe995 NEWS: mention the zeroconf_name %h substitution 2018-10-31 19:26:17 +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 56112a237c Listen: listen on $XDG_RUNTIME_DIR/mpd/socket by default 2018-10-30 22:14:54 +01:00
Max Kellermann 901229699e release v0.20.23
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlvXjC0QHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEtCPD/sF4XSIfAOGeosHvCxJGJbia630TXIcgiGa
 5Idku72YHrCrpHtK4Wn9AxWHkVHn3hTTma7fziwtOiXgyrPR/2P5WqcdaGqGgGX0
 dUQkjDh5iBakTLpr1k7RapA7UaZU47Qp++V+6iU42SFjYXO/f1NYD0ltAWwygWm9
 qzFrTAaKmOqi3h+Cv0ZlwVrOEWdjkoqQ+9REvaivUljMRIFNLn197Y+cCDlrlPXX
 4v0LgYQ6dm4f62K9nqKvAe1ERKL6QO4uz4pSM5zd98+CE34Th/f0liN2SbvNF/xw
 rJY0G1kL1Jrmst5UBldcCCVqV1UGJ3wVejRDHZykazuaM5weHRtSR7tcbfVaZIyW
 3w3EyM7D2O7m2AqWSDpBsY1w97NxIlFm2JizE3FvCcf4hhvuNgKuXxS8NBS/zttv
 o4igWOZUw76VzhcR8hnlDduKdz+Ht/MuT3ziSPuBQlj0coJYmHkqziO6+sI+bXve
 1bzX/KNEd9DiN+kxR34U9fRKOCtUGfCZwvGRqiQcIEm/Uo/UrszAM2sXK6bQoPj2
 1ZEXJuvFJr3rLe4rsTZn7g12yIqwuSA+0xeMpR0NQvUFnsI4aWokgvo1MVWp934q
 D0yrGMuRJyTB5mq6jS119ZX+ReCqI5H2IPZ7hkHK6Sia0jFE+ySjNFTqpkaMo1mB
 4EfBNZPctg==
 =m57f
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.23'

release v0.20.23
2018-10-29 23:44:47 +01:00
Max Kellermann 637c96697f release v0.20.23 2018-10-29 23:31:17 +01:00
Max Kellermann 9b6a2589e5 Merge branch 'v0.20.x' 2018-10-29 23:06:32 +01:00
Max Kellermann cc5fab28af pcm/FloatConvert: fix compile-time integer overflow for S32
The compile-time calculation for `factor` overflows because `1<<31`
cannot be represented by `int`.  By casting to `uintmax_t` first, we
can avoid this overflow.

Closes #380
2018-10-29 22:50:54 +01:00
Max Kellermann 7aa1dceef6 player/Control: move IDLE_PLAYER to Player::SeekDecoder()
This emits the event even if PlayerControl::Play() is used to replay
the current song, which emits the missing "player" idle event.

Closes #381
2018-10-29 12:01:48 +01:00
Max Kellermann a75d2fdd5a NEWS: mention the new clang crash bug workaround 2018-10-29 12:01:28 +01:00
Max Kellermann e02c1adf79 increment version number to 0.20.23 2018-10-29 11:05:27 +01:00
Max Kellermann c2a2573aa5 release v0.20.22
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlvPX+UQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFElO8EACgPMaiN3m/x1hzJ3QTLzCXgeqSG1vuv1tC
 F+sFISLPx/IoVjTpvd9H8jMt7lD+SYB620pAfNyLIGZpWcTxu1wmaviOghqCqnGP
 sql0vtS9CrRGhsKDi5earox3zecylWJ3PRPXpy/4NjFuFUxE2ij/wbXzDb9UbtMg
 1WnVL++fAlFj54CnPR35XHglYU+X7/bMWApkVUfsKBgyX9aghqLYUIm0jaUjj3Bs
 xB/2Nemd1A88yrc4kqyzbFsN96S/W2eXhDYfPlDwFdplfoRJ8nrEMdwrsn0nabIF
 7x+OsAGAfrz3e00TZdiDSaIy7VU4EFV9ctZVonoCGUluBHL0iG7G7bj2cnd+hVnZ
 ecidfHMUqVO99elmUtWsUQwzbhL/TxM6Fzn2qDwqdwcCWDgHcn4fpXfsY0MRt6NK
 cUhCyspMTuhqS3ohLO6RfiWDActm6QL2IHiDty/WAe1Td0VjOiRQMq7CADHlgn/D
 IalN8kGyWHK5ew+3Iiw5zRoYjNXG4ALZN8cEqVh2R7i2uxh8+qm46HkhticAjfDM
 4mETs3oAZdpOGCgv6Q0eY7tQDKB13DD/303NJaVFb6Iew2TZCWDbFz5HjqYShCZi
 PgnPosdRg0LoQbMah4Uhsj6frs6LEBMpg6c7nScJN/1MoRaOyVNDg03X+rBmPe5z
 XULvdsZ8Sw==
 =8OQx
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.22'

release v0.20.22
2018-10-23 20:10:57 +02:00
Max Kellermann 9274bc15bc release v0.20.22 2018-10-23 19:52:37 +02:00
Max Kellermann 751fff07fb input/Error: work around clang bug leading to crash
Closes #373
2018-10-23 19:52:22 +02:00
Max Kellermann 005e691339 decoder/fluidsynth: adapt to API change in version 2.0
Closes #360
2018-10-23 18:44:28 +02:00
Max Kellermann 61eff1cddf Makefile.am: install the SVG icon
Closes #366
2018-10-22 18:39:50 +02:00