summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-06-16db/Interface: CollectUniqueTags() allows multiple "groups"Max Kellermann
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-05decoder/OpusReader: return StringViewMax Kellermann
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-05output/httpd: reject some well-known request pathscathugger
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-05output/httpd: use strncmp instead of memcmpcathugger
memcmp use may result in out of bounds access
2019-06-05output/httpd: fix indentMax Kellermann
2019-05-31Revert "player/Thread: remove unnecessary "pipe" check"Max Kellermann
This reverts commit ff3e2c05142c94efadee00812ec348c15f1be1ba. 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-20player/Thread: fix "single" mode race conditionMax Kellermann
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-20player/Thread: remove unnecessary "pipe" checkMax Kellermann
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-17input/buffered: check error in IsAvailable()Max Kellermann
2019-05-16input/buffered: rethrow read_error in Check()Max Kellermann
2019-05-16input/buffered: wake up client thread on seek errorMax Kellermann
2019-05-16input/buffered: fix deadlock bugMax Kellermann
2019-04-23input/smbclient: wrap in MaybeBufferedInputStreamMax Kellermann
This enables the input buffer for remote files and caches file contents in MPD. Closes https://github.com/MusicPlayerDaemon/MPD/issues/376
2019-04-18LocateUri: pass URI plugin kind, optionally disables plugin verifyMax Kellermann
Commit b3a458338a7c8ff3c230ee33d85e973d3dbc056a 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-18neighbor/smbclient: fix double smbc_closedir() callMax Kellermann
There is already one call in ReadServers(), which is the correct place to do it.
2019-04-18CommandLine: fix another build failure with -Ddatabase=falseMax Kellermann
Split several printf() calls to make it easier to deal with all those #ifdefs.
2019-04-18Fix meson.build to work properly with '-Ddatabase=false'Eugene Gorodinsky
2019-04-04event/SocketMonitor: don't cancel if OnSocketReady() returns falseMax Kellermann
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-04event/{Fully,}BufferedSocket: add more API documentationMax Kellermann
2019-04-04zeroconf/Bonjour: fix OnSocketReady() return valueMax Kellermann
Keep the SocketMonitor registered. This wrong return value was added 6 years ago in commit 72cf8dd8a0451a4d9dae14a68483dc31adc61b09, andd apparently, nobody ever noticed.
2019-04-04output/httpd: close client connection on errorMax Kellermann
This missing piece probably never really hurt, because HttpdClient::OnSocketClosed() would be called right after a socket error, but it's better to be explicit about closing on error.
2019-04-03output/httpd: add missing mutex lockMax Kellermann
2019-04-03output/httpd: add more API documentation about lockingMax Kellermann
2019-04-03net/IPv[46]Address: add cast to void* to fix GCC9 build failureMax Kellermann
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-03-29input/curl: use std::throw_with_nested() instead of logging the exceptionMax Kellermann
Let the caller decide what to do with the original exception.
2019-03-29input/smbclient: use std::throw_with_nested() to construct PluginUnavailableMax Kellermann
Preserve the original exception.
2019-03-29decoder/HybridDSD: downgrade log message to "debug"Max Kellermann
This plugin is interesting only for a tiny fraction of MPD users, so let's not spam everybody else's log with it.
2019-03-29command/playlist: invoke the RemoteTagScanner on all newly added songsMax Kellermann
Closes https://github.com/MusicPlayerDaemon/MPD/issues/234
2019-03-29Haiku: remove redundant calls to delete_sem()François Revol
Fixes #184. Semaphores are kernel-managed objects, calling delete_sem() twice is not more dangerous than calling close() twice on an fd though, it would just return an error.
2019-03-29Haiku: add version info to the resources like win32 doesFrançois Revol
2019-03-29Haiku: fix adding resourcesFrançois Revol
The custom_command was run in src/haiku/ and created a file with only resources inside. Since xres edits the file in-place and meson doesn't like it, we have to run a shell script for now. Maybe later I'll add proper support in meson.
2019-03-29Haiku: fix buildFrançois Revol
2019-03-24filter/AutoConvert: implement Flush()Max Kellermann
2019-03-24filter/Filter: fix typo in API docMax Kellermann
2019-03-20event/ServerSocket: runtime error if abstract sockets are unavailableMax Kellermann
2019-03-20event/ServerSocket: add HAVE_UN check to AddAbstract()Max Kellermann
Closes https://github.com/MusicPlayerDaemon/MPD/issues/510
2019-03-20event/ServerSocket, doc, ...: refer to AF_LOCAL as "local socket"Max Kellermann
.. and not "UNIX domain socket. Be consistent about the naming.
2019-03-18src/lib/gcrypt/meson.build: use dependency() for quering linker flagsJörg Krause
Since version 0.49.0 the Meson build system has native support for finding and using the gcrypt library using the `dependency()` function. `dependency()` has the advantage over `find_library()` as it queries the required linker flags for proper linking with external libraries, e.g. libgpg-error. As the latest released version 1.8.4 of libgcrypt does not provide a .pc file, using `libgcrypt-config` is the only way to query the required linker flags. Unfortunately, there is an issue when cross compiling mpd and the user does not define `libgcrypt-config` in the cross file. If the user sets the qobuz feature to `auto` and the target does not have libgcrypt installed, the Meson build system will falsly assume libgcrypt is available for the target as it uses the native `libgcrypt-config` on the host and pretend is has found the library. Therefore, we still rely on `find_library()` to workaround this buggy behavior. This way, if qobuz feature detection is set to `auto`, the feature is disabled in case there is no target libgcrypt available. Fixes building mpd statically with the qobuz feature enabled. Otherwise the build fails with undefined references because of the missing libgpg-error dependency: ``` /sysroot/usr/lib/libgcrypt.a(libgcrypt_la-visibility.o): In function `gcry_strerror': visibility.c:(.text+0x14): undefined reference to `gpg_strerror' ```
2019-03-17PlaylistFile: ignore empty playlist namesMax Kellermann
Closes https://github.com/MusicPlayerDaemon/MPD/issues/465 and https://github.com/MusicPlayerDaemon/MPD/pull/466
2019-03-17lib/xiph: disable Tremor detection if libvorbis was foundMax Kellermann
And disable libvorbis detection if Tremor was explicitly enabled. This fixes a crash bug caused by libvorbis/Tremor ABI conflict caused by commit 4f7d52dbf2eaee15a517363c846650d76f45739f
2019-03-17decoder/ogg: ignore the BOS packet after seek to the beginning of songMax Kellermann
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-17output/sles: enable power saving modeMax Kellermann
2019-03-17output/plugins/OSXOutputPlugin: add boost meson dependencyJacob Vosmaer
2019-03-16output/pulse: use pa_channel_map_init_extend() instead of _auto()Max Kellermann
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-16decoder/opus: fix replay gain when there are no other tagsMax Kellermann
The `tag_builder.empty()` check was wrong for the SubmitReplayGain() call. Closes https://github.com/MusicPlayerDaemon/MPD/issues/497
2019-03-16song/TagSongFilter: apply negation properly to multiple tag valuesMax Kellermann
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-16song/StringFilter: remove obsolete #ifMax Kellermann
2019-03-16song/StringFilter: make MatchWithoutNegation() publicMax Kellermann
2019-03-15song/TagSongFilter: eliminate Match(TagItem)Max Kellermann
2019-03-15song/TagSongFilter: add code commentsMax Kellermann