Commit Graph

13986 Commits

Author SHA1 Message Date
Max Kellermann e00464435b util/Compiler.h: move compiler version checks to meson.build 2019-08-02 15:53:16 +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 86d0534638 lib/xiph/OggVisitor: more API documentation 2019-08-02 13:56:00 +02:00
Max Kellermann 1033dbca2b playlist/Song: add missing includes 2019-07-29 11:31:30 +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 83b0871248 test/test_translate_song: remove unused variable "s1" 2019-07-29 09:52:57 +02:00
Max Kellermann d8aec4b2dc test/run_decoder: catch StopDecoder
This exception is usually thrown by class DecoderBridge, but the Opus
plugin (ab)uses it as well, so we need to catch it.
2019-07-12 17:49:12 +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 0c0a354753 output/alsa: add a new flag "waiting" for xrun management
In DispatchSockets(), when there was not enough data, but enough for
current playback, the method would disable the "active" flag so the
next Play() call would re-enable the MultiSocketMonitor.

This was an abuse of the flag which could result in a crash
in Cancel(), because that method asserts that the period_buffer is
empty, which it may be not.

The solution is to add anther flag called "waiting" which shares some
behavior with the old flag.
2019-06-28 18:04:49 +02:00
Max Kellermann 3c5f860fb8 output/alsa: Cancel() also affects "active" (documentation) 2019-06-28 18:04:49 +02:00
Max Kellermann 3da1fa88d0 output/alsa: fix comment typo 2019-06-28 18:04:49 +02:00
Max Kellermann fac15aaffb output/alsa: fix comment typo 2019-06-28 14:39:54 +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 f07f8f7d88 decoder/wildmidi: add fallbacks for libwildmidi<0.4
Fix build breakage from commit ea639269d8
2019-06-26 23:13:23 +02:00
Max Kellermann 39b40ac1fd decoder/wildmidi: remove unused variable wildmidi_domain 2019-06-26 23:10:20 +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 0abaa3ecc5 decoder/wildmidi: throw PluginUnavailable if config file does not exist
This makes the configuration error more visible, possibly addressing
one part of https://github.com/MusicPlayerDaemon/MPD/issues/589
2019-06-26 22:38:40 +02:00
Max Kellermann c4d3efe71d decoder/List: handle exception PluginUnavailable 2019-06-26 22:02:54 +02:00
Max Kellermann 85e82e3d4d decoder/List: annotate exceptions thrown by DecoderPlugin::Init() 2019-06-26 22:01:45 +02:00
Max Kellermann f44011519c meson.build: increase protocol version to 0.21.11
Commit 1eae9339f2 added support for
multiple "groups" in the "list" command, and this change allows
clients to detect that this behavior, which had been documented for
several years, is now implemented properly.
2019-06-18 15:35:38 +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 79839db3a3 output/oss: return early if PcmExport::Export() returns empty array
This can happen if the DoP converter doesn't get enough source samples
for one destination quad.  This isn't a critical bug, because the OSS
plugin doesn't support DoP yet, but it's good to be prepared.
2019-06-17 21:07:30 +02:00
Max Kellermann d478bdda8e pcm/Export: document that Export() may return an empty buffer 2019-06-17 21:07:29 +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 923c1b6220 doc/include: remove obsolete DocBook fragment 2019-06-11 09:29:20 +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
cathugger 4b81cf0c2c output/httpd: use strncmp instead of memcmp
memcmp use may result in out of bounds access
2019-06-05 21:53:46 +02:00
Max Kellermann e7acbf112c output/httpd: fix indent 2019-06-05 21:53:43 +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 0f488dcecf doc/protocol.rst: binary responses do have a newline after all
Closes https://github.com/MusicPlayerDaemon/MPD/issues/568
2019-05-31 16:47:41 +02:00
Max Kellermann 17039aec70 doc/user.rst: more heading corrections
According to http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#sections
2019-05-31 16:30:06 +02:00
Max Kellermann fb6cb07912 doc/developer.rst: remove outdated section about the clang static analyzer 2019-05-31 16:27:43 +02:00
Max Kellermann e9e0e02db3 doc/user.rst: use ".. note:" 2019-05-31 16:26:52 +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 1b902e00b4 doc/protocol.rst: several clarifications
Closes https://github.com/MusicPlayerDaemon/MPD/issues/340
2019-05-20 17:06:20 +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 ff3e2c0514 player/Thread: remove unnecessary "pipe" check
The "queued" flag can only possibly be set if the decoder is still
decoding the current song or if the decoder is stopped.  This is also
what the following assert() checks.  This check was not necessary.
2019-05-20 16:20:59 +02:00
Max Kellermann 6922a2f55e input/buffered: check error in IsAvailable() 2019-05-17 12:43:45 +02:00
Max Kellermann ca5a400dbe input/buffered: rethrow read_error in Check() 2019-05-16 22:08:33 +02:00