Commit Graph

16925 Commits

Author SHA1 Message Date
Max Kellermann 547a084c7e output/PipeWire: call pw_stream_flush() in Cancel()
Clear not only MPD's ring buffer, but also libpipewire's buffers, to
avoid playing some audio from the previous song after a manual song
change.

Fixes part 1 of https://github.com/MusicPlayerDaemon/MPD/issues/1354
2022-07-09 01:01:29 +02:00
Max Kellermann 493677ff81 output/PipeWire: skip Cancel() if already drained 2022-07-09 00:53:53 +02:00
Max Kellermann 6b430ba271 output/PipeWire: activate stream in Drain() 2022-07-09 00:53:20 +02:00
Max Kellermann bc6924d303 output/snapcast: fix busy loop while paused
Removing the LockHasClients(); this code was copied from the "httpd"
output plugin, but unlike "httpd", the SnapCast output plugin does not
feed silence while paused, so we need to implement a delay to avoid
busy-looping the CPU.

As a side effect, this eliminates the suttering after resuming
playback, because the timer now gets reset even if there is a client.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1394
2022-07-08 22:55:41 +02:00
Max Kellermann 02b00f9146 output/PipeWire: don't force initial volume=100%
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1484
2022-07-08 18:25:41 +02:00
Max Kellermann e807ed5870 output/PipeWire: ignore SPA_PROP_channelVolumes if n_values==0
After connecting, PipeWire sometimes sends SPA_PROP_channelVolumes
with no values, and this led to "volume=-NaN".
2022-07-08 18:13:33 +02:00
Max Kellermann f08944253b output/PipeWire: check SPA_PROP_channelVolumes, not control name
Since PipeWire 0.3.53, there is no control name anymore, therefore the
name check doesn't work anymore, breaking volume change events.

This obsoletes the crash bug fix in commit 2ee57f9b0d
2022-07-08 18:06:36 +02:00
Max Kellermann 792d6584b9 output/PipeWire: move code to OnChannelVolumes() 2022-07-08 18:02:36 +02:00
Max Kellermann 7b45d01462 output/PipeWire: update field "volume" 2022-07-08 17:44:39 +02:00
Max Kellermann 5c17b2966a output/PipeWire: use std::accumulate 2022-07-08 17:44:08 +02:00
Max Kellermann 0c54f29446 output/PipeWire: document field "volume" 2022-07-08 17:30:57 +02:00
Max Kellermann 9c3cf39fdd output/PipeWire: catch exceptions in ParamChanged()
Fixes a potential crash bug.
2022-07-08 17:24:41 +02:00
Max Kellermann d2fb229685 output/PipeWire: call ::SetVolume() in ParamChanged()
This is a lower-level function without some of the clutter of
PipeWireOutput::SetVolume() which is not needed in that case.
2022-07-08 17:21:17 +02:00
Max Kellermann f55bc6682f output/PipeWire: move code to ::SetVolume() 2022-07-08 17:19:10 +02:00
Max Kellermann 6857286b42 decoder/Thread: don't scan for replay gain tags in PCM streams
This disables a long delay for playing songs from the cdio_paranoia
input plugin if ReplayGain is enabled.
2022-07-08 16:33:19 +02:00
Max Kellermann c0d5bd2048 decoder/Thread: move code to DecoderControl::LockIsReplayGainEnabled() 2022-07-08 16:21:53 +02:00
Max Kellermann 666e5d7904 input/CdioParanoia: use integer modulo to calculate "diff" 2022-07-08 16:04:05 +02:00
Max Kellermann 3613407ac5 input/CdioParanoia: use typedef lsn_t 2022-07-08 16:03:04 +02:00
Max Kellermann c32dceb4d4 input/CdioParanoia: remove loop from Read()
The Read() method is not required to fill the whole buffer.  By
returning as soon as at least one byte was read, we allow faster
cancellation.
2022-07-08 16:01:23 +02:00
Max Kellermann 5573e78364 input/CdioParanoia: skip seek if seeking within the buffer 2022-07-08 13:57:11 +02:00
Max Kellermann 807a19889f input/CdioParanoia: update offset only after successful seek
If seeking fails, don't leave the class with a wrong offset.
2022-07-08 13:57:11 +02:00
Max Kellermann df7242de91 input/CdioParanoia: eliminate redundant field "lsn_relofs" 2022-07-08 13:36:59 +02:00
Max Kellermann d62426f168 input/CdioParanoia: eliminate redundant field "lsn_to"
Use "size" instead.
2022-07-08 12:42:49 +02:00
Max Kellermann 1714cf3417 input/CdioParanoia: use IsEof() in Read() 2022-07-08 12:42:42 +02:00
Max Kellermann 1080c917be input/CdioParanoia: use std::min() 2022-07-08 12:37:21 +02:00
Max Kellermann 8eb3164878 input/CdioParanoia: fix crash if no drive was found
cdio_get_devices_with_cap() can return nullptr if no drive was found,
or it can instead return an empty list.  The latter caused MPD to
crash.
2022-07-08 12:05:20 +02:00
Max Kellermann 915c5442d1 input/CdioParanoia: use AtScopeExit() for cdio_free_device_list() 2022-07-08 12:03:57 +02:00
Max Kellermann be0360d5e8 doc/user.rst: clarify .mpdignore documentation
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1532
2022-07-08 11:44:14 +02:00
Max Kellermann 4d6ae6ffdd output/PipeWire: add nullptr check to SetVolume()
If the PipeWire output has not yet been enabled and no thread_loop has
been created yet, a nullptr dereference in SetVolume() was possible
because nullptr was passed to pw_thread_loop_lock().
2022-07-08 11:32:59 +02:00
Max Kellermann ecee6f415b mixer/MixerInternal: remember error details
If a mixer is not open, rethrow the original exception each time
setting the volume is requested.  This further improves error messages
sent to MPD clients.
2022-07-08 11:11:53 +02:00
Max Kellermann 47680f936b mixer/All: auto-open "global" mixers
If a mixer is "global", it is available even if the output isn't
open.  However, since the check was changed from IsEnabled() to
IsReallyEnabled(), enabled outputs have not yet been used have not
been "really" enabled yet, preventing using the mixer.

Fixes a regression by commit 35dbc1a90c
(part of https://github.com/MusicPlayerDaemon/MPD/pull/1480).

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1563
2022-07-08 11:05:26 +02:00
Max Kellermann 2d7181105d output/MultipleOutputs: SetVolume() throws on error
This reveals more about the nature of an error instead of just
returning "problems setting volume".
2022-07-08 10:56:55 +02:00
Max Kellermann 9bdc75524b python/build/libs.py: update CURL to 7.84.0 2022-07-08 10:13:52 +02:00
Max Kellermann 2f6ceb4949 python/build/libs.py: update OpenSSL to 3.0.5 2022-07-08 10:10:42 +02:00
Max Kellermann cd933aa35f subprojects: update fmt and vorbis 2022-07-08 10:08:27 +02:00
Max Kellermann 138738075b libfmt 9 support
libfmt version 9 broke the API by removing fmt::make_args_checked().

Fixes https://bugs.debian.org/1014543
2022-07-08 10:06:53 +02:00
Max Kellermann 2ee57f9b0d output/PipeWire: add nullptr check, fixing crash with PipeWire 0.3.53
Since PipeWire 0.3.53, control names can apparently be nulled, leading
to crashes in applications assertion that the string cannot be
nullptr.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1558
2022-07-04 19:20:08 +02:00
Max Kellermann 5a5655b790 lib/curl/Adapter: catch and postpone exceptions in WriteFunction()
This fixes a std::terminate() crash in the CURL storage plugin when
PropfindOperation::OnHeaders() throws an exception after receiving a
non-207 status.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1559
2022-07-01 12:43:42 +02:00
Max Kellermann b88d1e6820 lib/curl/Headers: make the comparison type "transparent" 2022-07-01 12:17:41 +02:00
Max Kellermann 19d2864c34 lib/curl/Headers: central type definition for the header map 2022-07-01 12:17:36 +02:00
Max Kellermann 29e3a17f26 lib/curl/Request: move code from SetupEasy() to Setup.cxx 2022-07-01 12:17:26 +02:00
Max Kellermann 252e9f736f lib/curl/Request: move code to class CurlResponseHandlerAdapter 2022-07-01 12:17:20 +02:00
Max Kellermann 5d08988dda lib/curl/Handler: fix typo 2022-07-01 12:17:17 +02:00
Max Kellermann 47ca4246aa lib/curl/Request: add constructor with CurlEasy parameter 2022-07-01 12:17:13 +02:00
Max Kellermann f8338d4f00 lib/curl/Request: use std::size_t 2022-07-01 12:16:59 +02:00
Max Kellermann 5cf6032c90 lib/curl/Request: move code to SetupEasy() 2022-07-01 12:16:55 +02:00
Max Kellermann 8d8b77412d lib/curl/Request: add API docs 2022-07-01 12:16:50 +02:00
Naglis Jonaitis fd9114e7e2 doc/user.rst: fix neighbor plugin config block name 2022-06-08 12:57:27 +02:00
Max Kellermann a3fba2f8f7 python/build/libs.py: update CURL to 7.83.1 2022-05-24 10:56:29 +02:00
Max Kellermann e2b671f1b2 python/build/libs.py: add --disable-vulkan to FFmpeg configuration
Fixes Android build failure with NDK r25 beta4 because "vulkan_beta.h"
was not found.
2022-05-24 10:55:55 +02:00