Max Kellermann
eee91aa4ea
util/Exception: update copyright
2018-08-21 08:20:52 +02:00
Max Kellermann
855750c784
util/{Const,Writable}Buffer: add method SetEnd()
2018-08-21 08:20:17 +02:00
Max Kellermann
4f2163e76c
system/FileDescriptor: include cleanup
2018-08-20 17:25:42 +02:00
Max Kellermann
eef66dee04
system/FileDescriptor: pass FileDescriptor to CheckDuplicate()
2018-08-20 17:23:14 +02:00
Max Kellermann
7ad440ca1c
net/SocketDescriptor: make eventfd() and signalfd() mandatory on Linux
2018-08-20 17:16:07 +02:00
Max Kellermann
13b3e9e7b3
system/FileDescriptor: make inotify_init1() mandatory on Linux
2018-08-20 17:12:50 +02:00
Max Kellermann
8106929d60
system/FileDescriptor: add pipe2() wrapper
2018-08-20 17:05:29 +02:00
Max Kellermann
795baed3f5
system/FileDescriptor: make pipe2() mandatory on Linux
2018-08-20 17:04:43 +02:00
Max Kellermann
5487d40be9
system/FileDescriptor: add operator!=
2018-08-20 16:49:14 +02:00
Max Kellermann
5e512763d3
system/UniqueFileDescriptor: make the base class public
2018-08-20 16:38:27 +02:00
Max Kellermann
a65d02d3ae
system/FileDescriptor: add "noexcept"
2018-08-20 16:34:47 +02:00
Max Kellermann
2156fc64f4
util/StringStrip: more API documentation
2018-08-20 16:30:46 +02:00
Max Kellermann
441440101d
util/StringStrip: add more "nonnull" attributes
2018-08-20 16:28:43 +02:00
Max Kellermann
ec54754e22
Compiler.h: move to util/
2018-08-20 16:19:17 +02:00
Max Kellermann
0ebba73cb8
net/SocketDescriptor: add method GetPeerCredentials()
2018-08-20 16:11:17 +02:00
Max Kellermann
50c7337965
net/SocketDescriptor: add GetType(), IsStream()
2018-08-20 16:06:58 +02:00
Max Kellermann
b5c569cd30
system/FileDescriptor: add IsPipe(), IsSocket()
2018-08-20 16:05:03 +02:00
Max Kellermann
11396d4fba
net/SocketAddress: add method GetLocalRaw()
2018-08-20 15:59:17 +02:00
Max Kellermann
4c6ae4e9e8
net/IPv4Address: add various helper methods
2018-08-20 15:57:13 +02:00
Max Kellermann
9cb9154b08
net/IPv4Address: add struct sockaddr_in constructor
2018-08-20 15:57:13 +02:00
Max Kellermann
234a6193bb
net/SocketAddress: make GetAddress() constexpr
2018-08-20 15:57:13 +02:00
Max Kellermann
2bf5f32224
net/IPv4Address: add API documentation
2018-08-20 15:50:25 +02:00
Max Kellermann
82d0f68acf
net/IPv4Address: add static method ConstructInAddrBE()
2018-08-20 15:48:52 +02:00
Max Kellermann
616c8383c0
net/IPv4Address: check _WIN32 instead of WIN32
2018-08-20 15:48:49 +02:00
Max Kellermann
5de46268af
net/IPv4Address: add "noexcept"
2018-08-20 15:43:35 +02:00
Max Kellermann
489e11072e
util/WritableBuffer: add ConstBuffer cast operator
2018-08-20 15:36:50 +02:00
Max Kellermann
5e2af15e94
util/Manual: add static method Cast()
2018-08-20 15:35:43 +02:00
Max Kellermann
3fbb54e0a4
util/IterableSplitString: use operator==(nullptr_t)
2018-08-20 15:35:09 +02:00
Max Kellermann
fe6de14faf
util/StringView: add ConstBuffer cast constructors
2018-08-20 15:34:07 +02:00
Max Kellermann
e85b9960f0
util/StringCompare: use StringAPI.hxx
2018-08-20 15:33:16 +02:00
Max Kellermann
75c836fbd9
util/StringAPI: use StringCompare() in StringIsEqual()
2018-08-20 15:31:09 +02:00
Max Kellermann
94b1025780
util/RuntimeError: fix typo
2018-08-20 15:22:24 +02:00
Max Kellermann
36ca9d01fb
util/ForeignFifoBuffer: shift the buffer in MoveFrom() on demand
...
The API documentation says "move as much data as possible", and if
there is room at the head of the buffer, we should use that if the
room after the tail is not large enough.
2018-08-20 15:21:05 +02:00
Max Kellermann
3bceed1b53
util/ForeignFifoBuffer: add "noexcept"
2018-08-20 14:53:39 +02:00
Max Kellermann
90de2c4bd6
util/Exception: move code to NestCurrentException()
2018-08-20 14:52:54 +02:00
Max Kellermann
9d63c8220b
util/Cast: reverse operands in ContainerAttributeOffset()
...
The result shall be positive.
2018-08-20 14:23:02 +02:00
Max Kellermann
edd9d16c84
util/Cast: move OffsetPointer() to OffsetPointer.hxx
2018-08-20 13:46:18 +02:00
Max Kellermann
ec373eba5d
util/BindMethod: add "noexcept"
2018-08-20 13:45:41 +02:00
Max Kellermann
0dfb27b7e5
util/StringAPI: stpcpy() was added in Bionic API level 21
2018-08-20 13:31:23 +02:00
Thomas Guillem
735f62be0c
storage/nfs: implement follow
2018-08-20 11:29:27 +02:00
Thomas Guillem
a04e01d5f5
lib/nfs/Connection: add Lstat
2018-08-20 11:29:11 +02:00
Max Kellermann
0b7d7fe069
Merge branch 'v0.20.x'
2018-08-20 11:27:56 +02:00
Thomas Guillem
9127afbf3f
lib/nfs/Connection: use nfs_stat64_async
...
Since nfs_stat_async is deprecated.
2018-08-20 10:51:24 +02:00
Max Kellermann
616abdda26
Merge branch 'v0.20.x'
2018-08-20 00:19:31 +02:00
Thomas Guillem
aff070bcbb
android: add LogListener
...
A Java object to send logs on the android side.
2018-08-19 23:32:24 +02:00
Max Kellermann
cc64c715a2
db/update/Service: Enqueue() throws on error
2018-08-19 23:15:52 +02:00
Max Kellermann
9999914c74
Main: throw exception instead of calling FatalError()
2018-08-19 23:13:29 +02:00
Max Kellermann
bd32a11016
config/Global: remove obsolete library
2018-08-19 23:08:41 +02:00
Max Kellermann
140aeea300
Main: allocate ConfigData on the stack
2018-08-19 23:08:23 +02:00
Max Kellermann
afd0fe666a
config/Global: move config_global_check() to Check.cxx
2018-08-19 23:01:30 +02:00
Max Kellermann
5f95c07305
config/Path: add InitPathParser()
...
Eliminate yet another access to the global ConfigData instance.
2018-08-19 22:29:39 +02:00
Max Kellermann
1a9659ef45
output/Init: pass global configuration in struct AudioOutputDefaults
2018-08-19 07:52:23 +02:00
Max Kellermann
aaa438e745
mixer/Type: mixer_type_parse() throws on error
2018-08-19 07:49:54 +02:00
Max Kellermann
4531e4cc55
filter/LoadChain: move code to class FilterFactory
...
Eliminate a use of GetGlobalConfig().
2018-08-18 20:57:02 +02:00
Joshua Wise
29f78b18b1
storage/plugins/CurlStorage: URL-encode paths in CurlStorage::MapUTF8
...
When using a database that was not created with a WebDAV music_directory
(i.e., if using a remote database, on which updates happen locally) and
using the Curl storage plugin, MPD would previously send GET requests that
had unescaped spaces in them. This change uses Curl's URL-encode API to
solve this.
2018-08-17 23:03:56 +02:00
Max Kellermann
147872fe97
lib/curl/Easy: add curl_easy_escape() wrapper
2018-08-17 23:02:49 +02:00
Max Kellermann
1ba35e1fd4
release v0.20.21
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlt3CwMQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEiQcD/0S7NzE9nLsuTJJB9ElzOW17XiKkLKuDErQ
P1r46APwa0agqfHFTUM5a+ifMCFQ4QTh0p+MiImYniBKmTnuKYBxZJFgHYojrPOS
jxJbPJI6R7vLfo07kIem1jw/3YjqF4BDJyn9FYLBLgWz3IiFC/H4XH4XYxoQhTYL
Xv0aGMCnil6gD2ENvx4by3tqsM9l5ktvPwR6bktRw4ImhgT5zHShpuPYZekas1ic
+A1oCXFO4UrlZQ0sHdcG7Up8NOEJvAiNR5+BCnb9aR8l6M2Mzu2u715zSSWvTBI+
SCa8lE/gkndJC2Q3BmPRp+OcWU/uwVIkWdJdCF8DgN5vmk3cLRJ/SpHGkR1iYSvF
MUW8QF0tc2Xctv0NHYXlDj6wVVJ+OWNUcNy6SWHAT7o5S0ppB+2nesAfTVqqGK/Z
yRmcW5CvYNH8dfN7WBkLehN57dpI6O1YkfF30xCPcT+fu4oBYv7owU4MqFVcJN2r
FEbTZCfRFGjF7Kmb6aF+mFMhTnqYNEZjFS0SljLJWjlimLaSfgTXdEv23IpxIMnV
i+CEy7B2RseR31tmCekyWxdLnNJPYC4Zqwer8dd7yrY/exEM/6x9JQDUbCaGccar
NlwmCj6uDKXxU3tkb9Mk77oX51dFL58BtpoQw/DfXRWSX+UsAxFioyAbJ9juJUrM
JO9WMABo0Q==
=2zvn
-----END PGP SIGNATURE-----
Merge tag 'v0.20.21'
release v0.20.21
2018-08-17 20:02:27 +02:00
Max Kellermann
98efb4f6d5
android: raise minSdkVersion to 21
...
The number of MPD installs on Android < 5.0 is negligible, and that
API version introduces lots of useful features for MPD.
2018-08-17 19:01:37 +02:00
Max Kellermann
4ba3812baf
Merge branch 'fchmod_fix' of git://github.com/1848/MPD
2018-08-14 23:14:10 +02:00
1848
4797357fa9
fixed setting unix socket permissions
...
first call fchmod() to prevent TOCTTOU, then apply permissions using
chmod()
2018-08-14 22:53:19 +02:00
Max Kellermann
f6b3a88723
Merge branch 'master' of git://github.com/skidoo23/MPD
2018-08-14 19:02:37 +02:00
Max Kellermann
fcf487f4e0
playlist/cue: support file type declaration "FLAC" (non-standard)
...
According to http://wiki.hydrogenaud.io/index.php?title=Cue_sheet FLAC
files should use the "WAVE" file type, but I recently encountered CUE
files declared as "FLAC" which could not be read by MPD.
2018-08-13 08:18:18 +02:00
skidoo23
82e8913c05
decoder/sidplay: support basic and kernal rom (libsidplayfp)
2018-08-12 14:25:11 +02:00
Max Kellermann
c46483a4ab
tag/Config: support incremental "metadata_to_use" setting
...
With a "+" or "-" prefix, the "metadata_to_use" setting can manipulate
the existing default. This way, one can enable `TAG_COMMENT` without
having to list all the other tags.
2018-08-10 18:46:47 +02:00
Max Kellermann
0f19108ce3
tag/Config: use SplitString()
2018-08-10 18:46:16 +02:00
Max Kellermann
4208fe29b5
tag/Mask: add method Unset()
2018-08-10 18:46:15 +02:00
Max Kellermann
c1b33533da
event/ServerSocket: fix get_remote_uid() call
...
This call was broken since commit
9a5bcc6db0
because the
`UniqueSocketDescriptor` had already been moved.
2018-08-09 13:22:25 +02:00
Max Kellermann
66fcd25b7e
command/sticker, sticker/song: embed struct sticker_song_find_data in namespace
...
Fixes `-Werror=odr`
2018-08-09 12:57:47 +02:00
Max Kellermann
01d3777574
decoder/Thread, ...: log all exceptions
2018-08-09 11:14:40 +02:00
Max Kellermann
87570cdd9b
Merge branch 'HttpdOutputPlugin_socket' of git://github.com/1848/MPD
2018-08-08 16:57:24 +02:00
Max Kellermann
0ea6a2dd99
decoder/mpg123: remove obsolete const_cast hack
2018-08-07 22:52:38 +02:00
Max Kellermann
cacc1ffdad
decoder/mpg123: use AtScopeExit() to call mpg123_delete() during scan
2018-08-07 22:48:11 +02:00
Max Kellermann
cfe34647e1
decoder/mpg123: use AtScopeExit() to call mpg123_delete()
2018-08-07 22:29:51 +02:00
1848
737267cedc
Moved call to fchmod() on socket from OneServerSocket::Open() to socket_bind_listen()
2018-08-07 22:01:13 +02:00
1848
84054203af
Use fchmod instead of chmod for unix sockets to prevent TOCTTOU
2018-08-07 21:30:25 +02:00
1848
0c1a899fbe
Added unix socket support in HttpdOutputPlugin
2018-08-07 19:28:29 +02:00
1848
52521d02ea
Added a function for generic address parsing
...
Changed listen_add_config_param() to use generic address parsing
2018-08-07 19:18:33 +02:00
Yue Wang
2127a482da
Fix various bugs in OS X DSD playback
...
the most notable bugs are
1. osx_output_set_device_format should use the target asbd rather than AudioFormat. This is because asbd's sample rate calculation reflects the real dop target rate of the DAC, white AudioFormat's sample rate is the original DSD format rate.
2. the original code value the highest rate that's the multiple of the target rate. This cause DOP always have the wrong rate chosen. This is also not necessary for PCM playback --- MPD's goal is bit perfect, and it's meaningless to raise to two or four times the PCM sample rate.
3. if sample_rate cannot be synchronized, the test for falling back to PCM is wrong. If the file format is in DSD format such fallback is necessary, whatever the params.dop setting is.
2018-08-07 01:55:06 -07:00
Max Kellermann
7df0d3b7fc
event/SignalMonitor: make SignalMonitorFinish() noexcept
2018-08-06 12:01:46 +02:00
Max Kellermann
fdd101c4c5
event/SignalMonitor: add noexcept
2018-08-06 12:00:49 +02:00
Max Kellermann
4218f56f6c
system/SignalFD: add "noexcept"
2018-08-06 11:58:37 +02:00
Max Kellermann
dd18fe34a7
system/SignalFD: throw exception on error
2018-08-06 11:58:29 +02:00
Max Kellermann
5b09504a71
system/Event{FD,Pipe}: add "noexcept"
2018-08-06 11:57:40 +02:00
Max Kellermann
0c1a001622
system/Event{FD,Pipe}: throw exception on error
2018-08-06 11:49:38 +02:00
Max Kellermann
148c38fbb9
Main: use AtScopeExit() to delete the Instance
2018-08-06 11:42:46 +02:00
Max Kellermann
fbfefcc0a3
Main: call daemonize_finish() with AtScopeExit()
2018-08-06 10:47:06 +02:00
Max Kellermann
b4c517c501
song/AudioFormatFilter: add mask support
2018-08-02 21:34:29 +02:00
Max Kellermann
b39bc85e60
AudioFormat: add mask support to ToString()
2018-08-02 21:18:36 +02:00
Max Kellermann
603ce87ac2
AudioFormat: split the printf() calls in ToString()
...
Prepare for formatting masks.
2018-08-02 21:17:54 +02:00
Max Kellermann
4b16a8bf84
lib/icu: require at least version 50
2018-08-02 21:01:39 +02:00
Max Kellermann
ca4c81dd84
decoder/mikmod: require at least version 3.2
2018-08-02 20:45:14 +02:00
Max Kellermann
e9881bbfc8
configure.ac: detect libmikmod with pkg-config
2018-08-02 20:42:25 +02:00
Max Kellermann
69f4178bff
decoder/ffmpeg: require at least version 11.12
...
This is the version in Debian Jessie (oldstable).
2018-08-02 20:18:19 +02:00
Max Kellermann
027e562f65
song/OptimizeFilter: optimization stage for filters
2018-08-02 19:42:53 +02:00
Max Kellermann
e5e623ffaa
SongFilter: add class NotSongFilter
2018-08-02 19:22:55 +02:00
Max Kellermann
592d2ebd26
song/AudioFormatSongFilter: new filter type
2018-08-02 17:28:17 +02:00
Max Kellermann
299c809272
song/Filter: convert LOCATE_TAG_* macros to enum
2018-08-02 17:23:25 +02:00
Max Kellermann
d929d0c26f
song/Filter: move each class into a separate source
2018-08-02 13:54:36 +02:00
Max Kellermann
90201e9970
DetachedSong, db/LightSong, SongFilter: move to src/song/
2018-08-02 13:51:18 +02:00
Max Kellermann
a31da51fd9
lib/systemd/Watchdog: implement the systemd watchdog protocol
2018-08-02 11:15:35 +02:00
Max Kellermann
cf471e830f
Merge branch 'v0.20.x'
2018-08-02 11:07:40 +02:00
Max Kellermann
906972973e
case-insensitive URI scheme comparison
...
Required according to RFC 3986:
> An implementation should accept uppercase letters as equivalent to
> lowercase in scheme names
Closes #330
2018-08-02 11:01:45 +02:00
Max Kellermann
116edf5fce
util/ASCII: add StringStartsWithCaseASCII()
2018-08-02 10:42:28 +02:00
Max Kellermann
22192adbc8
lib/icu/Init: add class ScopeIcuInit
2018-08-02 10:17:31 +02:00
Max Kellermann
b8f3de693f
lib/icu/Init: add "noexcept"
2018-08-02 10:17:04 +02:00
Max Kellermann
68c023cdd8
config/Path: simplify expression
2018-08-02 09:43:48 +02:00
Max Kellermann
b18b0bf328
config/Path: remove unnecessary IsNull() check
...
`AllocatedPath::FromUTF8Throw()` will never return a nulled instance.
2018-08-02 09:43:17 +02:00
Max Kellermann
2a2c5d50ff
unix/PidFile: add "noexcept"
2018-08-01 20:27:56 +02:00
Max Kellermann
dfda0faac7
unix/{Daemon,PidFile}: throw exception on error
...
Don't use the bad `FatalError` library.
2018-08-01 20:20:29 +02:00
Max Kellermann
95acc4be07
Main: add "noexcept"
2018-08-01 20:16:40 +02:00
Max Kellermann
330a4cf573
Main: remove exception handler from mpd_main_after_fork()
...
Let MainOrThrow() forward it to mpd_main().
2018-08-01 20:15:54 +02:00
Max Kellermann
6ffbb151a0
Main: move log_deinit() call to mpd_main()
...
Deinitialize the logging library after the last exception handler,
because that one could still need it.
Use `AtScopeExit()` to ensure it's always called, even if an exception
was thrown.
2018-08-01 20:14:31 +02:00
Max Kellermann
271e49db5d
Main: move code to MainOrThrow(), leaving exception handler in mpd_main()
2018-08-01 20:13:27 +02:00
Max Kellermann
8d2101ccb4
Main: move libdbus cleanup to class ODBus::ScopeInit
2018-08-01 19:24:50 +02:00
Max Kellermann
7aa8497546
SongFilter: implement the AND operator
2018-07-30 10:19:31 +02:00
Max Kellermann
7a8d5070f5
Songfilter: move code to ExpectWord()
2018-07-30 10:18:42 +02:00
Max Kellermann
8707ae6fd4
Songfilter: allow redundant parantheses
2018-07-30 10:00:44 +02:00
Max Kellermann
8786b61636
SongFilter: make ParseExpression() static
2018-07-30 09:57:04 +02:00
Max Kellermann
1b5faf5cbf
SongFilter: move code from SongFilter to AndSongFilter
2018-07-29 18:39:47 +02:00
Yue Wang
1e88e71b9a
[OSXOutputPlugin] Fix a bug that the stream sample rate is missing
...
the code here tried to guard DSD features behind ENABLE_DSD. However, the sample rate setting should be shared between two scenarios.
40a1ebee29 (diff-ce7ecec9ea9ca3df90d9c290cb3ef9d4R795)
The code runs fine if the dac supports the sample rate, as Mac OS will use the device rate if stream rate is 0.
However, when DAC is uncapable of processing the sample rate, a wrong rate (device rate) will be used for the stream rate.
2018-07-28 00:06:56 -07:00
Max Kellermann
e16fd4a09b
input/qobuz: initialize the libgcrypt library
2018-07-26 18:26:46 +02:00
Max Kellermann
7db7568dcf
lib/gcrypt/MD5: move code to util/HexFormat.cxx
2018-07-26 17:46:56 +02:00
Max Kellermann
409d3c7136
lib/gcrypt/MD5: return a StringBuffer
2018-07-26 17:45:45 +02:00
Max Kellermann
7f81375861
lib/gcrypt/MD5: move code to Hash.hxx
2018-07-26 12:14:31 +02:00
Max Kellermann
0de39a431b
lib/gcrypt/MD5: relicense to BSD-2
2018-07-26 12:14:00 +02:00
Max Kellermann
1726278ccc
SongFilter: make several macros internal
2018-07-25 11:32:41 +02:00
Max Kellermann
8661a51aba
SongFilter: make locate_parse_type() static
2018-07-25 11:30:56 +02:00
Max Kellermann
42ec67168a
command/Database: don't use locate_parse_type()
2018-07-25 11:29:14 +02:00
Max Kellermann
91af2ebc2a
command/Database: move code to handle_list_file()
2018-07-25 11:27:12 +02:00
Max Kellermann
f7fb8a33d7
db/Print: pass TagType to PrintUniqueTags()
2018-07-25 11:21:47 +02:00
Max Kellermann
0505cb8f7e
db/Print: move code to PrintSongUris()
2018-07-25 11:18:45 +02:00
Max Kellermann
2cfccc1c34
SongFilter: make Item an interface
...
Prepare to allow more complex expressions.
2018-07-25 11:04:41 +02:00
Max Kellermann
438366effc
SongFilter: move code to class StringFilter
2018-07-25 11:04:41 +02:00
Max Kellermann
29d5ad667c
SongFilter: allow dash in tag name
...
Required for "modified-since".
2018-07-25 11:04:41 +02:00
Max Kellermann
235ddc0990
util/TimeISO8601: new utility library
2018-07-25 08:43:06 +02:00
Max Kellermann
517f5b1999
util/TimeConvert: new utility library
2018-07-25 08:34:52 +02:00
Max Kellermann
a8ac8b2563
TimePrint: remove unused time_t overload
2018-07-25 08:33:59 +02:00
Max Kellermann
78a65cf281
SongFilter: remove DetachedSong overloads
...
All DetachedSong instances should be converted to LightSong first,
which is a very cheap operation.
2018-07-25 07:43:05 +02:00
Max Kellermann
96017f58a5
decoder/ffmpeg: skip the av_probe_input_format() call
...
This is kind of a revert of commit
b2e3c0757b
, which is not any longer
necessary since commit 0dd4b52b63
removed the last call to `av_open_input_stream()`.
2018-07-25 00:07:16 +02:00
Max Kellermann
c8e6f50d55
input/buffered: fix bogus offset after Seek()
...
Instead of copying the offset from our `input`, copy the requested
offset to our `offset` attribute.
By the time Seek() finishes, our input's offset may have advanced
already, having read some more data, thus giving us a bogus offset.
This fixes spurious decoder failues (closes #320 ).
2018-07-25 00:01:43 +02:00
Max Kellermann
9263d6d07d
SongFilter: implement operator "!="
...
Closes #89
2018-07-24 23:24:42 +02:00
Max Kellermann
5271e81ebe
SongFilter: new extensible filter syntax
...
Will allow more complex fitler expression, such as negation (#89 ).
2018-07-24 23:05:36 +02:00
Max Kellermann
efb2051b30
SongFilter: add ToExpression()
2018-07-24 23:04:44 +02:00
Max Kellermann
a2b24cb5a2
SongFilter: pass std::string&& to Item constructor
2018-07-24 23:03:35 +02:00
Max Kellermann
a54f9ede2e
SongFilter: use std::list::emplace_back()
2018-07-24 23:03:33 +02:00
Max Kellermann
7f1b134137
SongFilter: basic support for negated items
...
Not yet wired to the protocol.
2018-07-21 11:20:50 +02:00
Max Kellermann
b34fd905c8
SongFilter: simplify Parse() loop
...
Consume the ConstBuffer instead of iterating it. This will allow
adding more complex parsers.
2018-07-21 07:36:42 +02:00
Max Kellermann
821f77325c
SongFilter: Parse() throws exception on error
2018-07-21 07:24:42 +02:00
Max Kellermann
bd8cf7c53d
SongFilter: make internal Parse() overload private
2018-07-21 07:21:27 +02:00
Max Kellermann
88c19c21ee
SongFilter: remove obsolete prototype
2018-07-21 07:15:43 +02:00
Max Kellermann
40ec819330
SongFilter: make a few methods private
2018-07-21 07:15:09 +02:00
Max Kellermann
34dbd03be1
SongFilter: convert "tag" to "unsigned"
...
Having this as one-byte integer actually adds overhead and saves no
memory due to padding.
2018-07-21 07:04:01 +02:00
Max Kellermann
b98263e86f
fs/io/OutputStream: relicense under BSD-2
2018-07-19 14:02:37 +02:00
Max Kellermann
f30265a9ee
config/File: support wildcards in "include"
2018-07-18 17:28:30 +02:00
Max Kellermann
fcbcec6856
fs/List: new library exporting ListWildcard()
2018-07-18 17:18:38 +02:00
Max Kellermann
b778fb38a9
util/StringAPI: add raw strcmp() wrapper
2018-07-18 17:18:34 +02:00
Max Kellermann
32290d5eb8
fs/Path: add method ToUTF8Throw()
2018-07-18 16:51:29 +02:00
Max Kellermann
f87265a4d5
fs/AllocatedPath: divert some methods to class Path
...
Eliminate duplicate code.
2018-07-18 16:51:29 +02:00
Max Kellermann
6448b31b11
util/StringAPI: add strpbrk() wrapper
2018-07-18 16:51:29 +02:00
Max Kellermann
998227cffc
fs/CheckFile: remove variable path_utf8
2018-07-18 16:51:29 +02:00
Max Kellermann
09f743dc1a
config/File: add directive "include_optional"
2018-07-18 13:10:36 +02:00
Max Kellermann
035f986a91
config/File: support absolute paths in "include"
2018-07-18 13:09:04 +02:00
Max Kellermann
b168a9d469
fs/Traits: add Apply()
2018-07-18 13:06:07 +02:00
Max Kellermann
2b1d6ad396
fs/{,Allocated}Path: add typedef Traits
2018-07-18 13:05:23 +02:00
Max Kellermann
06c2aef3c7
config/File: fix typo in comment
2018-07-18 12:39:39 +02:00
Max Kellermann
d06ef76e58
config/File: implement the "include" directive
...
This is an experimental draft. More needs to be done.
2018-07-18 11:27:41 +02:00
Max Kellermann
57729683b6
config/Data: pass new items by rvalue reference
2018-07-18 11:21:59 +02:00
Max Kellermann
9ff2606bb8
config/Data: use std::forward_list to manage params and blocks
2018-07-18 11:03:19 +02:00
Max Kellermann
fd80683ade
decoder/mad: make "gapless_mp3_playback" a block option
...
Remove another dependency on the config/Global library.
2018-07-18 10:50:09 +02:00
Max Kellermann
49efb6071c
config/Migrate: library to migrate deprecated settings
2018-07-18 10:25:02 +02:00
Max Kellermann
8df98932b1
config/Data: add methods AddParam(), AddBlock()
2018-07-18 10:17:45 +02:00
Max Kellermann
95481dda86
config/Global: remove unused function config_get_param()
2018-07-17 23:42:20 +02:00
Max Kellermann
113141bf2a
StateFileConfig: add attribute "restore_paused"
2018-07-17 23:40:14 +02:00
Max Kellermann
bcc1e51097
StateFile: add struct StateFileConfig
2018-07-17 23:27:50 +02:00
Max Kellermann
e8a7c6cee3
config/Global: remove unused function config_get_block()
2018-07-17 23:14:47 +02:00
Max Kellermann
0c8ffa1ac3
output/MultipleOutputs: use struct ConfigData
2018-07-17 23:13:35 +02:00
Max Kellermann
4f678aa244
neighbor/Glue: use struct ConfigData
2018-07-17 23:11:33 +02:00
Max Kellermann
3a4a430f6c
fs/Config: use struct ConfigData
2018-07-17 23:09:56 +02:00
Max Kellermann
36db40b224
client/Global: use struct ConfigData
2018-07-17 23:07:50 +02:00
Max Kellermann
426b9672cf
db/Configured: use struct ConfigData
2018-07-17 23:06:17 +02:00
Max Kellermann
4d80419982
pcm/ConfiguredResampler: use struct ConfigData
2018-07-17 23:04:26 +02:00
Max Kellermann
3983caa2c8
Listen: use struct ConfigData
2018-07-17 23:02:53 +02:00
Max Kellermann
0b4e0b7bcb
LogInit: use struct ConfigData
2018-07-17 23:02:06 +02:00
Max Kellermann
a9b8d5ecb6
Permission: use struct ConfigData
2018-07-17 23:00:42 +02:00
Max Kellermann
60b2338091
config/Global: remove unused function config_get_path()
2018-07-17 22:59:09 +02:00
Max Kellermann
d2594c6380
storage/Configured: use struct ConfigData
2018-07-17 22:57:08 +02:00
Max Kellermann
667daab056
config/Global: remove unused function config_get_unsigned()
2018-07-17 22:56:14 +02:00
Max Kellermann
2fc0a738ce
Main: use struct ConfigData
2018-07-17 22:54:16 +02:00
Max Kellermann
86c531b37d
config/Data: move std::chrono parsers from Global.hxx
2018-07-17 22:53:17 +02:00
Max Kellermann
a5b14a2ea7
Main: add local ConfigData reference
2018-07-17 22:48:43 +02:00
Max Kellermann
bf582bd969
ZeroconfGlue: use struct ConfigData
2018-07-17 22:44:16 +02:00
Max Kellermann
ad866f7a7d
db/update/Config: use struct ConfigData
2018-07-17 22:41:28 +02:00
Max Kellermann
338a6f2a96
db/update/Walk: move UpdateConfig initialization to class UpdateService
2018-07-17 22:39:52 +02:00
Max Kellermann
c3aa53cc97
db/update/Walk: move configuration to struct UpdateConfig
2018-07-17 22:36:37 +02:00
Max Kellermann
24a86dce21
tag/Config: use struct ConfigData
2018-07-17 22:34:11 +02:00
Max Kellermann
0209bc4ba7
ReplayGainGlobal: use struct ConfigData
2018-07-17 22:32:56 +02:00
Max Kellermann
dd57b81989
PlaylistFile: use struct ConfigData
2018-07-17 22:31:33 +02:00
Max Kellermann
ffe6819966
config/Global: move value parser code to struct ConfigData
2018-07-17 22:28:08 +02:00
Max Kellermann
8af75c78f8
config/{Global,Block}: throw exception on parser error
2018-07-17 22:23:04 +02:00
Max Kellermann
696add259b
config/Global: remove unused function config_find_block()
2018-07-17 22:15:10 +02:00
Max Kellermann
61a119b607
playlist/Registry: use struct ConfigData
2018-07-17 22:10:32 +02:00
Max Kellermann
0ff0aca2e2
input/Init: use struct ConfigData
2018-07-17 22:05:27 +02:00
Max Kellermann
7b02c0224c
filter/LoadChain: use struct ConfigData
2018-07-17 22:05:24 +02:00
Max Kellermann
57d77cc8a0
decoder/List: use struct ConfigData
2018-07-17 22:05:21 +02:00
Max Kellermann
9fe0585056
config/Global: add GetGlobalConfig()
2018-07-17 22:05:20 +02:00
Max Kellermann
8c366f0774
config/Data: automatic initialization
2018-07-17 22:05:18 +02:00
Max Kellermann
edb44a536a
util/PrintException: new utility class
2018-07-17 21:58:07 +02:00
Max Kellermann
eeaaea802a
config/Data: FindBlock() throws on error
2018-07-17 21:18:18 +02:00
Max Kellermann
15c36baefd
config/Data: add method FindBlock()
2018-07-17 21:16:20 +02:00
Max Kellermann
33deb84aa1
config/Data: make getters const
2018-07-17 21:16:11 +02:00
Max Kellermann
b211d31a64
config/Data: add getter methods
2018-07-17 21:11:52 +02:00
Max Kellermann
5b192beaa5
config/Global: remove ConfigBlock::SetUsed() call, let caller do that
...
This fixes an old bug which caused the "unused" warnings to be
unreliable; only the first block in the list was marked as being
"used", no matter if it was really used, and the rest was never marked
as "used", suppressing all warnings for them.
2018-07-17 21:08:41 +02:00
Max Kellermann
ef38330d74
config/Block: add method SetUsed()
2018-07-17 21:06:15 +02:00
Max Kellermann
987b60ae73
config/Block: make "used" mutable
2018-07-17 21:05:55 +02:00
Max Kellermann
7db0f7c4da
config/Param: remove unused "used" flag
2018-07-17 20:44:07 +02:00
Max Kellermann
a4eeaff63f
config/File: move duplicate code to ExpectValueAndEnd()
2018-07-17 20:28:50 +02:00
Max Kellermann
7807ddae57
config/Param: allow moving the value
2018-07-17 20:27:52 +02:00
Max Kellermann
566af6827e
config/Param: inline the constructor
2018-07-17 20:27:49 +02:00
Max Kellermann
bf046d895e
config/Param: use C++11 initializers
2018-07-17 20:27:47 +02:00
Max Kellermann
af33a9f4b8
config/Block: allow moving name and value
2018-07-17 20:27:46 +02:00
Max Kellermann
e9a4570891
config/Block: use C++11 initializers
2018-07-17 20:16:19 +02:00
Max Kellermann
99d5b61698
fs/Path: add operator/(Path,Path)
...
Modeled after std::filesystem::operator/() from C++17.
2018-07-17 18:33:32 +02:00
Max Kellermann
79e89eb23b
CommandLine: use constexpr Path instead of macros
2018-07-17 17:02:49 +02:00
Max Kellermann
d13a64455c
config/File: use nested exception to annotate file name and line number
2018-07-16 20:00:29 +02:00
Max Kellermann
816603fd9a
config/Config*: rename files, drop "Config" prefix
2018-07-16 19:50:07 +02:00
Max Kellermann
bf5f12a51f
Merge branch 'patch-4' of git://github.com/Wang-Yue/MPD
2018-07-16 18:59:17 +02:00
Yue Wang
866821765a
use uint_least32_t instead of long for timeout
2018-07-16 09:42:04 -07:00
Max Kellermann
c457d8e442
Merge branch 'can' of git://github.com/Wang-Yue/MPD
2018-07-16 18:14:04 +02:00
Yue Wang
c58dffa685
Implement Cancel() for OSXOutputPlugin
2018-07-16 09:06:07 -07:00
Max Kellermann
ba41690063
output/Interface: add method ChangeAudioFormat()
...
This is just the API design; there is no implementation yet, and no
caller.
2018-07-16 11:46:33 +02:00
Max Kellermann
86a37d0ed6
Main, pcm/SampleFormat, command/Error: remove obsolete GCC version checks
2018-07-16 11:04:05 +02:00
Max Kellermann
2fb5dbe62b
output/alsa: use spsc_queue::reset()
...
This method was added in Boost 1.58.
2018-07-16 11:04:01 +02:00
Max Kellermann
9c6b52ccee
Permission: add special permissions for local sockets
...
Closes #296
2018-07-15 22:27:35 +02:00
Yue Wang
79937c9495
Support timed_wait in microseconds level
...
Some Audio plugin (such as ALSA, and soon CoreAudio) already support microsecond level buffer time. However, current interval less than 1000 microseconds will cause a bug that the code treated as 0 ms.
2018-07-15 13:22:53 -07:00
Max Kellermann
8aa2c57413
client: pass permission mask to constructor
...
Prepare for per-listener permissions.
2018-07-15 21:51:33 +02:00
Max Kellermann
524a7f4560
Listen: simplify code flow in listen_global_init()
2018-07-15 21:35:35 +02:00
Max Kellermann
56bfff5a57
event/ServerSocket: add method IsEmpty()
2018-07-15 21:35:35 +02:00
Yue Wang
1d30df9b15
Update OSXOutputPlugin.cxx
...
some device seems to have issue with setting kAudioDevicePropertyVolumeScalar with kAudioObjectPropertyElementMaster. Use AudioToolbox 's kAudioHardwareServiceDeviceProperty_VirtualMasterVolume instead.
Ideally, we should get the steoro channels first, and set the kAudioDevicePropertyVolumeScalar for each channel, which is doable as presented in https://github.com/cmus/cmus/blob/master/op/coreaudio.c . I will do a follow up PR after refactor PR.
2018-07-13 22:27:24 -07:00
Yue Wang
ef84e5c8fa
further guard dop code by if (dop_enabled)
2018-07-13 16:36:29 -07:00
Yue Wang
6d2a30b860
Update OSXOutputPlugin.cxx
...
1 sec for pause is too long. we wait for the same amount of time as when ring buffer is not available for writing.
2018-07-13 16:14:59 -07:00
Yue Wang
9e0fa8e9ec
Fix a copy and paste from diff bug.
2018-07-13 15:53:51 -07:00
Yue Wang
5e8e038811
Enclose pcm_export into the ENABLE_DSD guard.
2018-07-13 15:31:48 -07:00
Yue Wang
e61a804b80
Simplify audio format assignment code
2018-07-13 15:09:11 -07:00
Yue Wang
40a1ebee29
Enable OSX output plugin to set hardware sample rate and bit depth at the same time
...
This PR will fix #271 .
special thanks to @coroner21 who contributed a nice way to score hardware supported format in #292
Also, The DSD related code are all guarded with ENABLE_DSD flag.
2018-07-13 12:48:43 -07:00
Max Kellermann
d4ce9c0df2
system/FileDescriptor: no-op implementation of *CloseOnExec() on Windows
...
Fixes the NFS client build, closes #305 .
2018-07-13 18:16:39 +02:00
Yue Wang
680fdb0338
enable macOS to use Hardware Mixer
...
- Update the mixer to set on device property instead of audio unit property. When user choose "hardware" as mixer type, they will be able to change the hardware device volume instead of the software (AudioUnit) volume.
- We don't use square root scale in volume calculation as previous code did. This will make the volume level in line with system volume meter --- That is, MPD will have the same percentage volume reading compared to System Setting (Either in "System Preference" or in "Audio Midi Setup" app)
2018-07-10 15:51:32 -07:00
Max Kellermann
727078f65d
decoder/flac: call TagHandler::OnAudioFormat()
2018-07-07 14:43:21 +02:00
Max Kellermann
d7f770ce73
decoder/flac: move flac_sample_format() to FlacAudioFormat.hxx
2018-07-07 14:40:02 +02:00
Max Kellermann
e1ddb63054
lib/xiph/FlacStreamMetadata: move code to Scan(FLAC__StreamMetadata_StreamInfo)
2018-07-07 14:33:53 +02:00
Max Kellermann
24b14c5aa5
decoder/flac: rename FlacMetadata.cxx to FlacStreamMetadata.cxx
2018-07-07 14:29:49 +02:00
Max Kellermann
2e116c9e28
lib/xiph/FlacMetadataChain: un-inline Read(InputStream)
2018-07-07 14:22:22 +02:00
Max Kellermann
37897d1550
decoder/flac: move class FlacMetadataChain to separate source
2018-07-07 14:18:00 +02:00
Max Kellermann
b153591790
decoder/flac: move FlacIOHandle.?xx to lib/xiph/
2018-07-07 14:17:03 +02:00
Max Kellermann
ee5653338d
decoder/flac: fix comment typo
2018-07-07 14:11:28 +02:00
Max Kellermann
032f47c0b0
lib/xiph/FlacMetadataIterator: disallow copying
2018-07-07 14:08:41 +02:00
Max Kellermann
1f4e4dd9b3
lib/xiph/FlacMetadataIterator: reuse default constructor
2018-07-07 14:08:18 +02:00
Max Kellermann
d43218ed16
lib/xiph/FlacMetadataIterator: proper CamelCase
2018-07-07 14:07:48 +02:00
Max Kellermann
3d43e4e954
decoder/flac: move class FLACMetadataIterator to separate source
2018-07-07 14:04:37 +02:00
Max Kellermann
b0d587ded7
decoder/flac: pass FLAC__Metadata_Chain* to FLACMetadataIterator ctor
2018-07-07 14:04:06 +02:00
Max Kellermann
1245b4a49f
decoder/wavpack: merge duplicate code into Scan()
2018-07-07 13:54:02 +02:00
Max Kellermann
d4ce6049c9
decoder/wavpack: call TagHandler::OnAudioFormat()
2018-07-07 13:52:58 +02:00
Max Kellermann
c236a85c13
decoder/wavpack: add CheckAudioFormat(WavpackContext)
2018-07-07 13:48:49 +02:00
Max Kellermann
9cf43eef67
decoder/wildmidi: call TagHandler::OnAudioFormat()
2018-07-07 13:43:29 +02:00
Max Kellermann
ed6d0aa548
decoder/wildmidi: convert WILDMIDI_SAMPLE_RATE to AudioFormat
2018-07-07 13:36:18 +02:00
Max Kellermann
3d27fffc50
decoder/opus: call TagHandler::OnAudioFormat()
2018-07-07 13:34:32 +02:00
Max Kellermann
de0ee26432
decoder/sndfile: call TagHandler::OnAudioFormat()
2018-07-07 13:29:39 +02:00
Max Kellermann
45cccbce59
decoder/sndfile: use AtScopeExit()
...
Fixes memory leaks.
2018-07-07 13:27:26 +02:00
Max Kellermann
479de9c7cb
decoder/sndfile: add CheckAudioFormat(SF_INFO)
2018-07-07 13:26:39 +02:00
Max Kellermann
60821232b9
decoder/audiofile: allocate AFvirtualfile with malloc()
...
afCloseFile() uses free(), so we need to use malloc().
2018-07-07 13:25:01 +02:00
Max Kellermann
9b4156a282
decoder/audiofile: add "noexcept"
2018-07-07 13:21:27 +02:00
Max Kellermann
89b1e27d2e
decoder/audiofile: merge duplicate code into CheckAudioFormat(AFfilehandle)
2018-07-07 13:21:09 +02:00
Max Kellermann
1dcaf8f76a
decoder/audiofile: call TagHandler::OnAudioFormat()
2018-07-07 13:18:06 +02:00
Max Kellermann
18508d1919
decoder/audiofile: merge audiofile_get_duration() into audiofile_scan_stream()
2018-07-07 13:16:38 +02:00
Max Kellermann
9f77d568e2
decoder/mad: call TagHandler::OnAudioFormat()
2018-07-07 13:10:39 +02:00
Max Kellermann
0d0569b9af
decoder/mad: merge mad_decoder_total_file_time() into mad_decoder_scan_stream()
2018-07-07 13:09:23 +02:00
Max Kellermann
0f18e7baf9
decoder/mpg123: call TagHandler::OnAudioFormat()
2018-07-07 13:08:06 +02:00
Max Kellermann
d8b03d4927
decoder/ffmpeg: call TagHandler::OnAudioFormat()
2018-07-07 13:02:08 +02:00
Max Kellermann
72b6c09a73
db/simple: add an AudioFormat to each Song
2018-07-06 22:49:02 +02:00
Max Kellermann
c05bca6f2c
tag/Handler: implement FullTagHandler::OnAudioFormat()
2018-07-06 22:46:03 +02:00
Max Kellermann
73c95d1fb2
TagFile: rename exported functions, use CamelCase
...
And specify whether generic tags are being scanned.
2018-07-06 22:33:35 +02:00
Max Kellermann
2c30e16371
db/simple/Song: remove obsolete comment
2018-07-06 21:50:53 +02:00
Max Kellermann
72437ca9e2
db/simple/Song: use C++11 initializers
2018-07-06 21:49:52 +02:00
Max Kellermann
a72d1200fb
require GCC 6
...
Meanwhile, GCC 5 fails to compile MPD due to incomplete C++14
implementation.
2018-07-06 19:44:32 +02:00
Max Kellermann
9a29d02e7e
Merge branch 'v0.20.x'
2018-07-06 19:43:01 +02:00
Max Kellermann
6f3c0d0a60
AudioFormat: include cleanup
2018-07-06 19:35:31 +02:00
Max Kellermann
466625f7ad
input/curl: use new class HttpStatusError
...
This way, IsFileNotFound() can detect status 404.
2018-07-06 19:26:11 +02:00
Max Kellermann
b8259e604a
db/update/{Walk,ExcludeList}: use InputStream to read .mpdignore
...
Supports .mpdignore on NFS/SMB and others (closes #290 ).
2018-07-06 19:19:04 +02:00
Max Kellermann
86e2075c63
lib/nfs/Connection: use new class NfsClientError
...
Allows callers to extract the NFS error code.
2018-07-06 19:17:34 +02:00
Max Kellermann
30900b2fe2
input/Error: new library providing IsFileNotFound()
2018-07-06 19:16:01 +02:00
Max Kellermann
fd7ae7ea4c
input/Domain: remove obsolete variable
2018-07-06 19:13:53 +02:00
Max Kellermann
60d5bf0240
util/StringFormat: new utility library
2018-07-06 19:07:02 +02:00
Max Kellermann
41cdc4e14b
input/Offset: add macro PRIoffset
2018-07-06 19:06:05 +02:00
Max Kellermann
87dfca0477
input/curl: remove obsolete Windows sprintf() fallback
...
See commit be137a191e
2018-07-06 19:05:09 +02:00
Max Kellermann
e1ee8e7812
util/FormatString: remove obsolete Windows fallback
...
Since 7d353bbe2a
, _GNU_SOURCE is always
defined, which implies __USE_MINGW_ANSI_STDIO and thus switches to
the mingw implementations of the printf() family. That's
standards-compliant, unlike Microsoft's CRT implementations.
2018-07-06 19:04:33 +02:00
Max Kellermann
63406efcd8
db/update/ExcludeList: allow comments only at start of line
2018-07-06 18:27:17 +02:00
Max Kellermann
d5c132fca0
db/update/ExcludeList: move code to ParseLine()
2018-07-06 18:25:27 +02:00
Max Kellermann
5f082a2739
output/httpd: remove broken DLNA support code
...
This code was added in 21851c0673
but
looks completely broken:
- the status code is "206 OK" but "206" would be "Partial Content"
- the "Content-Length" header has a bogus value
- the "Content-RangeX" parameter has different bogus values (why
"Content-RangeX" anyway and not "Content-Range"?)
Apart from that, there are strange undocumented non-standard headers
which are probably there to work around bugs/expectations in one
broken proprietary client product. But these days, MPD doesn't bend
over to support broken clients. So let's kill this code.
Closes #304
2018-07-06 17:28:01 +02:00
Max Kellermann
45139f94bb
db/LightSong: pass URI to constructor
2018-07-06 16:56:12 +02:00
Max Kellermann
80cb680fca
db/LightSong: implicit initialization
2018-07-06 16:50:37 +02:00
Max Kellermann
b9ff6383a4
db/LightSong: make Tag a reference
...
This enforces the "not nullptr" rule.
2018-07-06 16:47:47 +02:00