Wasapi output plugin won't start playing after being paused
The cause is that the scope guard in the WASAPI work thread
(WasapiOutputPlugin.cxx, function WasapiOutputThread::Work(), in the
while (true) loop) is set up too 'late' in the execution. There is one
condition ("if (data_in_frames >= buffer_size_in_frames)") when it is
hit, the loop will continue without executing the scope guard. This
scope guard is responsible for emptying the buffer again, and if the
buffer is not emptied, the above mentioned condition will stay true.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1451
This reverts commit 552c30eae4.
It has caused various problems; for example, MPD wasn't able to write
the pid_file (which was already mitigated by commit a4e4217204).
And apparently, the socket file created in the same directory by
mpd.socket disappears when mpd.service (re)creates the directory. I
could not reproduce this problem with 247.3, but maybe this is a bug
in older systemd versions?
Until we figure out why this happens, let's remove the
RuntimeDirectory directive. A future MPD version may be launched as
regular user, not as root, which will eliminate one major problem with
RuntimeDirectory.
Commit 552c30eae caused problems for those people who still had a
"pid_file" setting (even though that is obsolete with systemd),
because now /run/mpd is owned by root:root (our mpd.service has no
User=mpd directive, so systemd starts MPD as root).
To work around this problem, and to be able to keep
RuntimeDirectory=mpd (which solved a problem of other MPD users), the
best compromise seems to just ignore the "pid_file" setting when it is
of no use.
Unlike GetFilenameSuffix(), uri_get_suffix() removes the query string
first, which breaks file names with question marks in the name.
Therefore, uri_get_suffix() shall only be applied to remote URIs.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1316
Without clearing the "uri" field, the next Open() call attempts to
reuse the old InputStream, but it has already been closed, so Open()
always returns nullptr.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1300
With libfmt versions older than 7, this leads to an endless recursion
between Error() and FmtError(), resulting in a crash due to stack
overflow. D'oh!
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1295
During the libfmt migration, I converted "%1.3f" to just "{:1.3}"
without the "f" suffix, but libfmt defaults to scientific notation,
which can break some MPD clients.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1291