Max Kellermann
820debf45a
util/StringUtil: add FindStringSuffix()
2015-03-03 11:29:31 +01:00
Max Kellermann
c19292c036
Util/StringUtil: use std::copy_n()
2015-03-02 22:35:59 +01:00
Max Kellermann
4ee81e6a3d
PlaylistFile: limit variable scope
2015-03-02 22:19:47 +01:00
Max Kellermann
87a8a3e22f
PlaylistFile: move memchr() call to class Path
2015-03-02 21:48:37 +01:00
Max Kellermann
e9125ef8e4
PlaylistFile: use PathTraitsFS typedefs
2015-03-02 21:47:33 +01:00
Max Kellermann
6ff394bcc9
StorageCommands: use PathTraitsUTF8 for protocol argument
2015-03-02 21:25:55 +01:00
Max Kellermann
7ce96585f5
fs/Path: add method GetSuffix()
...
Type-safe wrapper for uri_get_suffix().
2015-03-01 01:09:53 +01:00
Max Kellermann
41cc31c124
SongUpdate: use OpenArchiveInputStream() to open archive file
...
Don't pass Path::c_str() to tag_stream_scan() which requires a UTF-8
string.
2015-03-01 00:48:44 +01:00
Max Kellermann
605af61a0f
db/simple: eliminate UpdateFileInArchive() if archive API is disabled
...
Reduce some unnecessary overhead.
2015-03-01 00:25:30 +01:00
Max Kellermann
77e163e5b8
Mapper: use Path::IsAbsolute()
2015-02-28 23:50:18 +01:00
Max Kellermann
0e00b9009d
fs/Path: pass Path to Relative()
2015-02-28 23:45:16 +01:00
Max Kellermann
a6dd998d31
fs/AllocatedPath: use PathTraitsFS::Relative()
...
Eliminate duplicate code.
2015-02-28 23:30:53 +01:00
Max Kellermann
cdd0ccc67a
fs/Path: rename RelativeFS() to Relative()
2015-02-28 23:19:34 +01:00
Max Kellermann
a918821868
fs/Traits: add missing dereference in RelativePathImpl()
2015-02-28 23:19:34 +01:00
Max Kellermann
c637b96f10
Win32Main: use TCHAR where appropriate
2015-02-28 23:15:46 +01:00
Max Kellermann
44b9197354
Mapper: use class Path
2015-02-28 23:00:27 +01:00
Max Kellermann
7a8f96b1dd
FileCommands: use PathTraitsFS typedefs
2015-02-28 23:00:26 +01:00
Max Kellermann
f4f21f462d
fs/CheckFile: convert path to UTF-8 for error message
2015-02-28 23:00:26 +01:00
Max Kellermann
d09b8b5bd7
fs/FileInfo: use GetFileAttributesEx() on WIN32
2015-02-28 23:00:26 +01:00
Max Kellermann
ee327db517
fs/FileSystem: remove unused WIN32 port of StatFile()
2015-02-28 23:00:26 +01:00
Max Kellermann
90a61b6bab
fs/FileInfo: new library providing GetFileInfo()
...
Replaces StatFile(), with a portable data object.
2015-02-28 23:00:26 +01:00
Max Kellermann
00583bc4a8
FileCommands: skip special files completely
...
Previously, MPD printed the time stamp without printing the file
name. That made no sense.
2015-02-28 23:00:26 +01:00
Max Kellermann
2d06a8e880
storage/FileInfo: rename to StorageFileInfo
2015-02-28 23:00:26 +01:00
Max Kellermann
e1a434edbc
fs/Path: make IsAbsolute() const
2015-02-28 23:00:26 +01:00
Max Kellermann
6b3b1cbd99
fs/FileSystem: use GetFileAttributes() on WIN32 if possible
2015-02-27 19:15:31 +01:00
Max Kellermann
4dd861ee23
fs/FileSystem: merge CheckAccess() into PathExists()
...
PathExists() should better do what CheckAccess() does, and
CheckAccess() doesn't do what its name implies.
2015-02-27 19:13:46 +01:00
Max Kellermann
4f0f81a047
fs/DirectoryReader: use FindFirstFile(), FindNextFile() on WIN32
2015-02-26 18:11:02 +01:00
Max Kellermann
e3908c8de6
fs/Traits: add constant CURRENT_DIRECTORY
2015-02-25 19:53:35 +01:00
Max Kellermann
81c49fba03
fs/AllocatedPath: add nullptr_t constructor
2015-02-25 19:53:35 +01:00
Max Kellermann
eb174d5ba3
fs/{Allocated,}Path,Charset: use PathTraitsFS typedefs
2015-02-25 19:17:45 +01:00
Max Kellermann
4c899e9c5a
fs/FileSystem: remove unused FOpenModes
2015-02-25 19:17:45 +01:00
Max Kellermann
00b0f6ad51
fs/io/File{Reader,OutputStream}: convert path to UTF-8 for error message
2015-02-25 19:10:51 +01:00
Max Kellermann
fe1e467a49
db/ExcludeList: use the TextFile class instead of stdio.h
2015-02-25 16:25:26 +01:00
Max Kellermann
64b9e7fd48
util/DynamicFifoBuffer: adjust include guard
2015-02-16 00:53:59 +01:00
Max Kellermann
12de22d3bb
net/StaticSocketAdress: new class wrapping struct sockaddr_storage
2015-02-13 21:16:43 +01:00
Max Kellermann
821bc6d777
system/ByteOrder: use GCC built-ins if available
2015-02-12 11:05:02 +01:00
Max Kellermann
6e66a5b77b
net/Resolver: relax size check in LocalAddressToString()
...
Handles abstract sockets on Linux.
2015-02-10 22:47:26 +01:00
Max Kellermann
cf5c10bbe6
net/Resolver: move code to LocalAddressToString()
2015-02-10 22:46:04 +01:00
Max Kellermann
4e30e74739
net/SocketAddress: light wrapper for struct sockaddr
2015-02-10 22:06:06 +01:00
Max Kellermann
42890b9acf
system/{Resolver,Socket{Error,Util}}: move to new library libnet.a
2015-02-10 22:06:06 +01:00
Max Kellermann
33a27379f9
Listen: add "override"
2015-02-10 22:05:57 +01:00
Max Kellermann
0cf57cc7ca
event/ServerSocket: remove obsolete macro DEFAULT_PORT
2015-02-10 20:27:45 +01:00
Max Kellermann
68fcbaf4c8
event/ServerSocket: remove obsolete typedef
2015-02-10 20:24:23 +01:00
Max Kellermann
9c83d3c78c
fs/io/FileOutputStream: use CREATE_ALWAYS instead of TRUNCATE_EXISTING
...
Fixes yet another breakage of creating the database+state file on
Windows.
2015-02-10 13:41:09 +01:00
Max Kellermann
676dfabc91
command/{Queue,File}Commands: drop "file:///" prefix for absolute paths
...
Requiring this prefix makes the client's intention very clear, but it
was too hard to understand why this prefix was needed. Initially, my
intention was to differentiate from broken clients which prefix relate
URIs with a slash; once MPD allowed that. In the past few years
however, MPD has disallowed that, and there was no significant
breakage (except for the "add /" special case which some clients
apparently still do). So I figure it's about time to define that an
URI that begins with a slash points to an arbitrary file on the file
system.
2015-02-09 07:55:06 +01:00
Max Kellermann
60e6d1d61b
fs/Charset: convert #ifdef to regular "if"
2015-02-09 07:44:21 +01:00
Max Kellermann
975e275030
fs/Charset: change FixSeparators() API to use std::string&&
2015-02-08 17:52:01 +00:00
Max Kellermann
afcd5670e3
Listen: remove C-style "void"
2015-02-07 12:15:10 +00:00
Max Kellermann
ff2b427cc1
release v0.19.9
...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJU1OdDAAoJECNuiljG20USazsQAKZuhjJJ8vjYCB7G/NGoi9tv
dImBQnQDiQTdE57kxa46loknbPc5/cSAYnLbR4PjQfMBqArtE6sAkAk72LKlYNqt
qMOEKPCBjv8ZjiGDbvL/X+WSKbrpm8iOf3Gu5BRIuWrMK/oXQMe5A028Ziyye//X
XfMKdPWkZFL6h/qGO082eCnCiTJaSRLwP6HSNF2pqv+JuFF7hyLkZvTVXo/ms85E
ezrx3Kjf8TuNX041uuso7qqUsD/sY2jZRZ26qfzJ1ODwJmgIfbXzat+ODFVNne55
E1nh5zpwIUxZ2+d6eJEzwLR3+FpmltPc1YLo2mnetD6f59SzpXjAycPLo1VoOhbQ
s4iXQEzNI2LwDebI3eiMXQaLIorHOGex3L6JYkO5LAqUkPrv/PBCJFJs8ixjCRbl
KL27WmWYiV0xfdCz4TtAxEt48LGMMjDfaSK4Hzo3vN3vZtIEy2p/pS9MhXDdxC8I
vql533N+A9fi2I+7bPauwX5ElOYvGTkDeKqKXDox/jR0zio55APst7IW9OIUCKxo
an98430jeNPhs1CNqxVIJNciC8Q4REmafki7UQiKYDBQjHyq3r6Bp547lnDhUtii
P9PNTyOoJXhV5yEP3upnWCxwH6Vy7IxBnwrEO7aEHs88Ea54iqlZ9XB8TzUw4G/1
I7T7a8yOopRopb04vhr2
=fd8f
-----END PGP SIGNATURE-----
Merge tag 'v0.19.9'
2015-02-06 17:15:31 +01:00
Max Kellermann
d38034bb5c
fs/io/FileOutputStream: don't auto-delete file on WIN32
...
The file handle is never reset to INVALID_HANDLE_VALUE, and thus the
destructor will assume the operation shall be cancelled and will
delete the temporary file.
This was a major breakage for saving the database file and the state
file.
2015-02-06 14:36:55 +01:00
Max Kellermann
a62fe30546
SongPrint: let CPP concatenate string literals
2015-02-06 13:06:38 +01:00
Max Kellermann
b3fe3e8b3d
TagBuilder: allow adding duplicate tag types in Complement()
...
Build a table of pre-existing tag types before adding new items. The
old way would check HasType() each time, which would return true after
the first instance of that tag type had been added, preventing
duplicate tag types to be merged.
This broke duplicate tag types loaded from the state file, because
this code path uses TagBuilder::Complement().
2015-02-06 12:25:34 +01:00
Max Kellermann
25ebb427da
tag/Rva2: convert pointers to references
2015-02-04 15:57:32 +01:00
Max Kellermann
c5bde10b4f
tag/Rva2: rename struct rva2_data to CamelCase
2015-02-04 15:56:59 +01:00
Max Kellermann
e582e893cc
tag/Rva2: make enum rva2_channel strictly-typed
2015-02-04 15:56:01 +01:00
Max Kellermann
833ec3d3cd
lib/upnp/Discovery: remove locking from ExpireDevices()
2015-02-03 23:48:11 +01:00
Max Kellermann
3d446d3266
lib/upnp/Discovery: apply naming convention
2015-02-02 21:12:19 +00:00
Max Kellermann
e660229c40
output/sles: use AudioOutputWrapper::Create()
2015-02-01 22:24:19 +01:00
Max Kellermann
ee6e0e16cb
DecoderThread: make variables more local
2015-01-31 22:20:38 +01:00
Max Kellermann
eb1733609a
decoder/sndfile, ...: update API documentation
2015-01-31 22:17:15 +01:00
Max Kellermann
e2e66404d5
decoder/DsdLib: fix integer overflow in ID3 size calculation
2015-01-30 23:22:49 +01:00
Max Kellermann
3ecb19d0f1
decoder/DsdLib: check size before seeking
2015-01-30 23:19:26 +01:00
Max Kellermann
fd02c87fa2
decoder/DsdLib: don't use InputStream::GetOffset() after seeking
...
We already know the offset.
2015-01-30 23:00:22 +01:00
Max Kellermann
63ac81c8f5
decoder/DsdLib: pass offset_type t dsdlib_tag_id3()
2015-01-30 22:47:43 +01:00
Max Kellermann
557bee61d5
Merge branch 'v0.19.x'
2015-01-29 22:55:18 +01:00
Max Kellermann
3adca3c2fa
db/update/Walk: use std::unique_ptr instead of std::auto_ptr
...
std::auto_ptr is deprecated, and std::unique_ptr is much better
anyway.
2015-01-29 08:37:23 +01:00
PHO
39abd3ecb4
Avoid integer overflow in MonotonicClock{S,MS,US}
...
This is Darwin specific: the previous implementation was causing an integer
overflow when base.numer is very large. On PPC Darwin, the timebase info is 1000000000/33330116 and this is too large for integer arithmetic.
2015-01-29 08:34:37 +01:00
Max Kellermann
7bf638b0de
decoder/DsdLib: use new[] to allocate the ID3 buffer
...
Don't abort the process if there's not enough memory. This buffer is
not important and can be large.
2015-01-29 08:24:34 +01:00
Max Kellermann
56662a703c
decoder/DsdLib: free ID3 buffer right after id3_tag_parse()
...
Merge two free() calls.
2015-01-29 08:24:34 +01:00
Max Kellermann
8b5f47d3a3
decoder/DsdLib: raise ID3 tag limit to 1 MB
...
A bug report was submitted with a 600 kB ID3 tag that could not be
read by MPD.
2015-01-29 08:20:14 +01:00
Max Kellermann
8bfb88840b
output/fifo: use template AudioOutputWrapper
2015-01-28 19:43:37 +01:00
Max Kellermann
593bb5a8a7
StickerDatabase: convert the struct name to upper case
2015-01-28 19:33:56 +01:00
Max Kellermann
ae7e1a22cb
Merge branch 'v0.19.x'
2015-01-26 20:57:29 +01:00
Max Kellermann
a289dcb9ee
Merge branch 'v0.18.x' into v0.19.x
2015-01-26 20:48:19 +01:00
PHO
023b9c1e7e
Test the existence of strndup(3) before using it.
...
This can eliminate the ad-hoc "#ifdef WIN32" and can also support other platforms lacking it as well (including Darwin 9).
2015-01-26 20:39:49 +01:00
Max Kellermann
ad1b6ef0ac
{playlist,input}/despotify: remove defunct plugin
2015-01-26 09:55:31 +01:00
Max Kellermann
16944b5397
pcm/SoxrResampler: move quality recipe names to table
2015-01-25 10:01:50 +01:00
Max Kellermann
ed5c6be2f1
util/list: disable gcc5 warning
...
This file has been removed in newer MPD versions, so don't care about
it now.
2015-01-23 16:50:31 +01:00
Max Kellermann
30cb082932
ClientProcess: cast enum to int before passing to printf()
...
Fixes gcc5 warning.
2015-01-23 16:50:31 +01:00
Max Kellermann
72e44d596f
tag/Format: add %iso8601%
2015-01-22 19:10:15 +01:00
Max Kellermann
8f2ca8f085
ConfigFile: fix typo (parser breakage)
2015-01-22 19:08:09 +01:00
Max Kellermann
6725c2afa1
util/format: allow upper case, digits and underscore in names
2015-01-22 18:59:42 +01:00
Max Kellermann
e9d4b73cc3
util/format: move code to is_name_char()
2015-01-22 18:59:01 +01:00
Max Kellermann
929ec70512
queue/PlaylistState: remove unused macro
2015-01-22 18:44:30 +01:00
Max Kellermann
6cd5d73607
pcm/SoxrResampler: allow multi-threaded resampling
2015-01-22 11:37:18 +01:00
Max Kellermann
80a7e1ea7d
pcm/SoxrResampler: add a global soxr_runtime_spec_t variable
2015-01-22 11:37:09 +01:00
Max Kellermann
0d3b26b3aa
Config: add section "resampler"
2015-01-22 11:04:28 +01:00
Max Kellermann
e9b49a43e2
config/Block: add method IsEmpty()
2015-01-22 10:20:51 +01:00
Max Kellermann
4fa5538e2b
config/Param: split block-specific attributes to new struct ConfigBlock
...
The old struct config_param remains only for top-level string options.
2015-01-21 23:56:33 +01:00
Max Kellermann
84e74173de
config/File: move code to ReadConfigParam()
2015-01-21 23:51:04 +01:00
Max Kellermann
6cdb2a4896
fs/io/BufferedReader: count line numbers
...
Replaces the dirty code in config/ConfigFile.cxx.
2015-01-21 23:43:32 +01:00
Max Kellermann
d8bef3270d
config/File: use FileReader/BufferedReader instead of stdio
2015-01-21 23:36:57 +01:00
Max Kellermann
a33db8fe6f
config/Data: assign nullptr during iteration
2015-01-21 23:30:00 +01:00
Max Kellermann
1c3f5517fa
config/Option: convert to strictly-typed enum
2015-01-21 23:30:00 +01:00
Max Kellermann
10972da060
input/curl: work around format warning on WIN32
2015-01-21 23:30:00 +01:00
Max Kellermann
a38f02541d
config/Param: make "line" signed
2015-01-21 22:19:36 +01:00
Max Kellermann
fdba76ba47
ConfigFile: convert macros to constexpr
2015-01-21 22:12:16 +01:00
Max Kellermann
f900ab0121
config/Data: add method Clear()
...
Move code from config_global_finish().
2015-01-21 21:50:02 +01:00
Max Kellermann
f80ab6a7a2
ConfigData: rename header file
2015-01-21 21:49:09 +01:00
Max Kellermann
6ed209bbf3
config/Param: make constructor "explicit"
2015-01-21 21:32:26 +01:00
Max Kellermann
fe85fa3bea
ConfigData: move struct config_param to Param.hxx
2015-01-21 21:23:02 +01:00
Max Kellermann
76b7882f33
ConfigData: rename struct block_param to BlockParam
2015-01-21 21:18:25 +01:00
Max Kellermann
bf0ab2d44c
ConfigData: move struct block_param to Block.?xx
2015-01-21 20:45:34 +01:00
Max Kellermann
276a0d9500
thread/Name: include stdio.h if HAVE_PRCTL
...
Caused a build failure with uClibc because snprintf() was not
available.
2015-01-21 20:40:56 +01:00
Max Kellermann
bcbfa560e9
pcm/SoxrResampler: use a global soxr_quality_spec_t variable
2015-01-21 19:59:50 +01:00
Max Kellermann
8b366f0795
pcm/SoxrResampler: soxr_parse_converter() returns unsigned long
2015-01-21 19:56:57 +01:00
Max Kellermann
aa08f9692c
pcm/SoxrResampler: add constant SOXR_DEFAULT_QUALITY
2015-01-21 19:56:36 +01:00
Max Kellermann
288ba84939
pcm/SoxrResampler: fix indent
2015-01-21 19:47:14 +01:00
Max Kellermann
4c74016b1a
MixerAll: restore "null" mixer volume from state file
2015-01-16 19:48:26 +01:00
Joshua Wise
1d8544ef3b
db/plugins/ProxyDatabasePlugin: add "keepalive" parameter
2015-01-15 14:44:55 -08:00
Max Kellermann
91a12f76cd
util/CharUtil: minor API documentation fix
2015-01-15 19:34:02 +01:00
Max Kellermann
e8debd2e45
output/recorder: dynamic file name
2015-01-14 22:03:26 +01:00
Max Kellermann
bf59635280
output/recorder: move code to encoder/ToOutputStream.cxx
2015-01-14 20:11:00 +01:00
Max Kellermann
eaf0662b75
fs/io/FileOutputStream: add static method Create()
2015-01-14 19:44:28 +01:00
Max Kellermann
b043b2a761
fs/AllocatedPath: add operator==
2015-01-13 10:42:29 +01:00
Max Kellermann
ac7e0dfb77
DetachedSong: remove obsolete friend declaration
2015-01-12 20:56:07 +01:00
Max Kellermann
05d47bb09a
output/null: convert struct to class
2015-01-09 19:30:22 +01:00
Max Kellermann
575a5bd0b8
output/null: move functions into the struct
2015-01-09 17:44:00 +01:00
Max Kellermann
ae4c189e19
encoder/Interface: move functions into the struct
2015-01-08 19:36:19 +01:00
Max Kellermann
362a6e6d46
encoder/Plugin: move struct Encoder to EncoderInterface.hxx
2015-01-08 19:31:57 +01:00
Max Kellermann
c76c7c68ff
output/recorder: convert struct to class
2015-01-08 16:56:22 +01:00
Max Kellermann
59ac9d39d5
output/recorder: move encoder_finish() call to destructor
2015-01-08 16:56:13 +01:00
Max Kellermann
ec41caade4
output/wrapper: add method SendTag()
2015-01-07 19:20:09 +01:00
Max Kellermann
06ec06cdd7
output/recorder: remove unused variable "recorder_output_domain"
2015-01-07 19:17:07 +01:00
Max Kellermann
b7acf86408
output/recorder: use FileOutputStream
2015-01-07 19:14:23 +01:00
Max Kellermann
58c4db925b
output/recorder: log commit errors
2015-01-07 19:13:55 +01:00
Max Kellermann
fe0c4ff3c2
output/recorder: move code to method Commit()
2015-01-07 19:11:04 +01:00
Max Kellermann
7a2af0fbf4
output/recorder: move more functions into the struct
2015-01-07 18:55:34 +01:00
Max Kellermann
d83127722f
output/oss: use nullptr instead of NULL
2015-01-07 18:55:34 +01:00
Max Kellermann
dc03ad05be
output/oss: add "const" attributes
2015-01-07 18:50:38 +01:00
Max Kellermann
a62df3cb8f
output/oss: eliminate unnecessary tail code after "switch"
2015-01-07 18:49:29 +01:00
Max Kellermann
18e32abda9
output/oss: convert struct to class
2015-01-07 18:43:52 +01:00
Max Kellermann
15d29da43b
output/oss: add "device" parameter to constructor
2015-01-07 18:43:45 +01:00
Max Kellermann
8b217d5313
fs/io/FileOutputStream: use O_TMPFILE if available
...
The Linux feature allows writing new files to an invisible file, and
then replace the old file. This preserves the old file if we get
interrupted by some event.
2015-01-06 19:38:55 +01:00
Max Kellermann
c150fd9a1c
output/oss: move functions into the struct
2015-01-06 16:24:33 +01:00
Max Kellermann
674d14879f
Merge branch 'v0.19.x'
2015-01-06 12:54:46 +01:00
Max Kellermann
37e9010887
input/async: reset the "open" flag after seeking successfully
...
Fixes a problem with the "curl" input plugin: IsEOF() always returns
true because the "open" flag was cleared by
CurlInputStream::RequestDone() when end-of-stream was reached. This
flag stays false even when seeking to another position has succeeded.
This patch resets the "open" flag to true after seeking successfully.
2015-01-06 12:46:28 +01:00
Max Kellermann
4bd2c75056
thread/Name: disable pthread_setname_np() on NetBSD
...
NetBSD's pthread_setname_np() prototype is incompatible with the rest
of the world, and it requires to pass the string argument as a
non-const pointer. Instead of working around this misdesign, I hereby
disable the feature on NetBSD.
2015-01-06 12:08:36 +01:00
Max Kellermann
b9ed850b98
thread/Name: enable FormatThreadName() with prctl()
...
Add macro HAVE_THREAD_NAME which is set when any method to set the
thread name is available. Use that macro in FormatThreadName()
instead of just checking for HAVE_PTHREAD_SETNAME_NP.
2015-01-06 12:04:30 +01:00
Max Kellermann
11cea17496
thread/Name: indent preprocessor commands
2015-01-06 12:04:15 +01:00
Max Kellermann
81df45a893
fs/io/File{Reader,OutputStream}: use OpenFile()
2015-01-05 23:13:35 +01:00
Max Kellermann
c1f0708a5d
output/recorder: use config_param::GetBlockPath()
...
Supports "~/" expansion. Forces us to switch from "const char *" to
AllocatedPath, which is a good thing.
2015-01-05 19:49:54 +01:00
Max Kellermann
153f5854e2
output/alsa: move functions into the struct
2015-01-04 19:53:56 +01:00
Max Kellermann
f532964fde
output/pulse: add wrapper for pa_threaded_mainloop_signal()
2015-01-04 19:51:09 +01:00
Max Kellermann
efea609dc3
output/pulse: convert to class
2015-01-04 19:46:51 +01:00
Max Kellermann
f3a160038d
output/pulse: move more code into the struct
2015-01-04 19:45:58 +01:00
Max Kellermann
f016eef48a
output/pulse: use AudioOutputWrapper::Init()
2015-01-04 19:44:45 +01:00
Max Kellermann
f649514183
output/openal: convert macro to constexpr
2015-01-03 20:00:41 +01:00
Max Kellermann
afd31677dd
output/openal: convert struct to class
2015-01-03 20:00:16 +01:00
Max Kellermann
b28710b08c
output/openal: move functions into the class
2015-01-02 18:40:16 +01:00