Commit Graph

1487 Commits

Author SHA1 Message Date
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
Max Kellermann c26703b7e6 SongFilter: check value.empty() after checking tag fallbacks
In this new order, a filter 'AlbumArtist ""' matches only on songs
which neither have `AlbumArtist` nor `Artist`.
2018-10-22 18:34:47 +02:00
Max Kellermann 66ab2de578 Merge branch 'v0.20.x' 2018-10-22 18:20:29 +02:00
Max Kellermann db27bb76e2 db: fix broken command "list ... group"
Grouping in the "list" command was completely broken from the start,
unlike "count group".  I have no idea what I have been thinking when I
wrote commit ae178c77bd, but it didn't
make any sense.

This commit is a rewrite of the feature.

For clients to be able to detect this feature, this commit also
increments the protocol version.
2018-10-22 13:08:24 +02:00
Max Kellermann 7cfe929c36 db/Count: print empty group if song without grouped tag exists
Be consistent with "list" responses.
2018-10-22 12:42:18 +02:00
Max Kellermann 53448e4633 tag/Fallback: add tag fallbacks for AlbumArtistSort, ArtistSort
Just like AlbumArtist falls back to Artist, AlbumArtistSort should
fall back tom AlbumArtist, ArtistSort and finally Artist.

Closes #355
2018-10-22 10:52:42 +02:00
Max Kellermann 01b6e1cbf2 test: use GTest instead of cppunit 2018-10-16 21:26:04 +02:00
Max Kellermann 94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann 5b2374b949 player/Thread: calculate `buffered_before_play` based on a fixed duration
Previously, there was the setting `buffered_before_play` which
specified a percentage of the audio buffer, defaulting to `10%`.  That
was working well enough for quite some time, until high-quality audio
formats became common.

At 44.1 kHz, 16 bit stereo, MPD collected 2.3 seconds worth of data in
the buffer before starting playback.  With the same default settings
and 192 kHz, 24 bit stereo, that was only 0.27 seconds.

Making this depend on the byte size only leads to high latency at low
quality, and too little data at high quality.  The natural choice
would be to use a duration instead of a byte size, which should give
the same good experience with all audio formats.

Since the `buffered_before_play` configuration setting was not
understood well by users and caused more harm than good, this commit
deprecates it.  It has now no effect.
2018-09-23 15:46:29 +02:00
Max Kellermann a8e70f0901 db/proxy: forward `sort` and `window` to server 2018-09-02 17:51:30 +02:00
Max Kellermann 2d0b429b6a db/proxy: require libmpdclient 2.9 2018-09-02 08:21:11 +02:00
Max Kellermann 616abdda26 Merge branch 'v0.20.x' 2018-08-20 00:19:31 +02:00