Commit Graph

8189 Commits

Author SHA1 Message Date
Max Kellermann
11cea17496 thread/Name: indent preprocessor commands 2015-01-06 12:04:15 +01:00
Max Kellermann
163597ef69 db/simple: fix implicit nullptr/bool conversion
Return false on error, not nullptr.
2014-12-26 14:34:03 +01:00
Max Kellermann
95f84afd33 fs/Traits, ...: work around -Wtautological-pointer-compare
New in clang 3.6.
2014-12-26 14:34:03 +01:00
Max Kellermann
9f7fd1fbfb db/lazy, input/mms: add "override" keywords
Fixes -Winconsistent-missing-override (clang 3.6).
2014-12-26 14:29:29 +01:00
Max Kellermann
940cab8620 Merge branch 'v0.18.x' into v0.19.x 2014-12-26 14:28:52 +01:00
Max Kellermann
665031467a db/proxy, output/shout: fix implicit nullptr/bool conversion
Return false on error, not nullptr.
2014-12-26 13:50:54 +01:00
Max Kellermann
df33171107 db/{simple,proxy}, ...: add "override" keywords
Fixes -Winconsistent-missing-override (clang 3.6).
2014-12-26 13:47:04 +01:00
Max Kellermann
53f4044890 util/{ASCII,UriUtil}, ...: work around -Wtautological-pointer-compare
New in clang 3.6.
2014-12-26 13:43:32 +01:00
Max Kellermann
a5049136ff DatabaseGlue: convert nullptr check to assertion 2014-12-26 13:43:32 +01:00
Max Kellermann
705b3c6b63 util/ASCII: fix indent 2014-12-26 13:37:38 +01:00
Max Kellermann
6b4ac66962 Compiler.h: add macro CLANG_CHECK_VERSION() 2014-12-26 13:31:03 +01:00
Max Kellermann
0964b06240 Compiler.h: add macro GCC_OLDER_THAN() 2014-12-26 13:30:44 +01:00
Max Kellermann
92eeca3ba7 util/Manual: reimplement GCC_CHECK_VERSION() using GCC_MAKE_VERSION() 2014-12-26 13:30:22 +01:00
Max Kellermann
2a86554ac4 Compiler.h: add macro GCC_MAKE_VERSION() 2014-12-26 13:30:11 +01:00
Max Kellermann
a56949e9fa decoder/ffmpeg: support interleaved floating point 2014-12-23 20:51:08 +01:00
Max Kellermann
43da4c0eca input/mms: limit the mmsx_read() size 2014-12-23 20:34:45 +01:00
Max Kellermann
b9c7771830 decoder/DsdLib: add missing stdlib.h include 2014-12-23 10:08:46 +01:00
Jan Brittenson
35db88affe DSF ID3 tags hitting 4k size limit
Here's a change to dynamically allocate the DSD ID3 tag buffer.
Pretty much anything with cover art is going to exceed the existing,
static 4k limit...  Here's a change to dynamically allocate the buffer
and sanity check it at some upper limit.  I rather arbitrarily pulled
256k out of thin air just to keep a corrupt file from causing it to
trying to allocate a buffer larger than available memory.
2014-12-23 09:49:33 +01:00
Max Kellermann
9c56c49e73 release v0.18.21
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUkcgMAAoJECNuiljG20UShwAP/3qGPv1feFJMOQbhHF+K8eL9
 4oeKJAblVR98+jsdu8Z7GidGGXrvIX8pxGWJPLLYSa2naR9/gtTxpiYZPEd2ex4G
 1jbFzI0GmU08I5x9sUPstX4GoDVfWnV3ICYzY7z1VVhlxYXlI+dHOPz61FxaLWYM
 i/H4WR7lvSwyOsYaFtfqZC9SD71XQ0V56yDqaDK6a/NbMg0WQQMghmH0swkEk/FK
 wN6nxEpFpTtOjBLjF51TyNC5JT1lxXDYwxYmrtd6rxkNqhN8duCRXq9IK7MEGync
 LNtHKGMrcXwLBSAPM6GTrY0StCch6fEBhOg0Tr7JQ81BSb/1XKzimbxCCULDwx/P
 /hN4lGr66tudXHFaRQX0GLxRpkpKtanp7+xtZ5AhGh4Wk7YQ62nb8RN3qCc5x2Oi
 cvnK6bewMi7rZoIejAhaXtbKNPho/H5TpE404C+ScnWyEAVtly45xgECNdzllhfk
 k4Kp4rW2CNmHTNbZRFh1Qre2g47a9rhZxoxXx4X0fi6YSruekQC3qjdloom5VN2I
 8d7NloQoJ+wjkYXuZ3EoxdBhbdViZBMg8CP99KFc7sYQTGmYtrKyjZ5EiOAVw3p5
 rHoTrGdZr8aKPMcKQPo4GaTkB9njE4a4l+uVq5SOiRSfpDeRqvhIqOrUz4EOf8Ic
 ryT0jwFGfKhSHG4tz+9K
 =WjqC
 -----END PGP SIGNATURE-----

Merge tag 'v0.18.21' into v0.19.x
2014-12-17 19:19:13 +01:00
Max Kellermann
c5720a15c7 LogBackend: force-flush stderr on WIN32
setvbuf() does not seem to have an effect on Windows.
2014-12-17 19:12:25 +01:00
Max Kellermann
90709b332a LogInit: make stderr line-buffered
Make sure everything gets logged right away.  No delays because
stdio's buffer is not yet full.
2014-12-17 19:12:01 +01:00
Max Kellermann
81f17d10c8 util/HugeAllocator: enable MEM_COMMIT on Windows
Without MEM_COMMIT, the reserved address space is not accessible, and
MPD crashes.
2014-12-17 19:10:58 +01:00
k44
773de38bd9 playlist/embcue: fix filename suffix detection
The definition of the playlist_plugin struct member of the embcue
plugin was incorrect.
2014-12-16 18:43:05 +01:00
Max Kellermann
a48704925d storage/nfs: add timeout 2014-12-15 00:45:13 +01:00
Max Kellermann
fa4beeee75 decoder/ffmpeg: detect and fix negative time stamps
Works around assertion failure due to something that appears to be a
(minor) FFmpeg bug.
2014-12-15 00:40:46 +01:00
Max Kellermann
68d1abdb85 storage/nfs: clear last_error in SetState()
Fixes bogus assertion failure.
2014-12-15 00:39:30 +01:00
Max Kellermann
7e8474a85a lib/nfs/Connection: unregister socket with SocketMonitor::Steal()
SocketMonitor::Cancel() does not actually unregister the socket; it
only disables the event.
2014-12-15 00:31:12 +01:00
Max Kellermann
82da364b8b lib/nfs/Connection: implement mount timeout 2014-12-15 00:05:53 +01:00
Max Kellermann
7fa91ec175 lib/nfs/Connection: add debug flag "in_destroy" 2014-12-15 00:03:30 +01:00
Max Kellermann
1d3a09d377 lib/nfs/Connection: add assertion 2014-12-14 22:51:37 +01:00
Max Kellermann
02563a35f0 lib/nfs/Connection: fix reconnect after mount failure
When mounting had not yet finished, SocketMonitor::IsDefined() was
always false, due to the workaround at the beginning of the function
that calls SocketMonitor::Steal().  This commit drops the IsDefined()
check because it was never necessary and breaks reconnect.
2014-12-14 22:49:16 +01:00
Max Kellermann
d653f35bb7 lib/nfs/Connection: fix typo in code comment 2014-12-14 22:49:09 +01:00
Max Kellermann
a543627abd lib/nfs/Connection: fix memory leak (and assertion failure)
nfs_destroy_context() will invoke all pending callbacks with
err==-EINTR.  In CancellableCallback::Callback(), this will invoke
NfsConnection::DeferClose(), which however is only designed to be
called from nfs_service().  In non-debug mode, this will leak memory
because nfs_close_async() is never called.

Workaround: before nfs_destroy_context(), invoke nfs_close_async() on
all pending file handles.
2014-12-14 16:02:47 +01:00
Max Kellermann
80f2ba7fca lib/nfs/Connection: move code to Service() 2014-12-14 15:45:10 +01:00
Max Kellermann
32bca64920 lib/nfs/Connection: add assertions 2014-12-14 15:40:29 +01:00
Max Kellermann
7fa1a84ec3 lib/nfs/Connection: move code to method InternalClose() 2014-12-14 15:38:09 +01:00
Max Kellermann
ab4bb26a0a lib/nfs/Connection: make in_service and in_event debug-only flags 2014-12-14 15:20:40 +01:00
Max Kellermann
4b8d258cff lib/nfs/Connection: fix crash while canceling a failing Open()
The method NfsConnection::CancellableCallback::Callback() will always
invoke NfsConnection::Close() on the file handle, even if the void
pointer is not a nfsfh.  This can happen if the Open() was not
successful, e.g. when the file does not exist.
2014-12-14 15:16:01 +01:00
Max Kellermann
3c29aa6271 event/Loop: read the "again" flag while holding mutex 2014-12-14 14:47:36 +01:00
Max Kellermann
51464b4317 lib/nfs/Connection: add assertions 2014-12-14 14:24:49 +01:00
Max Kellermann
2fec463542 util/HugeAllocator: disable MEM_LARGE_PAGES on Windows
MEM_LARGE_PAGES does not appear to work.  Instead, MEM_RESERVE appears
to be necessary.  Until I figure this out, this large pages are
disabled.
2014-12-12 13:20:58 +01:00
Max Kellermann
1affc641c4 input/Init: eliminate double colon from log message 2014-12-12 13:20:37 +01:00
Max Kellermann
0cfd4fff62 playlist/Print: don't skip non-existent songs in "listplaylist"
Skipping those songs silently will confuse the client, because
commands specifying the song index within a playlist
(e.g. playlistdelete) will be out of sync.

This copies spl_print()'s behavior to playlist_file_print().
2014-12-09 13:36:48 +01:00
Max Kellermann
cbc1a58e93 release v0.18.20
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUha5vAAoJECNuiljG20USdLEP/0NCwdnvCPVdkZ7RwsdCRp53
 jv86eu92uFVQJrW5/NQahngOwqNRsjNRX1EiEalbEjqCzMxDjuKCBukdteXg0Q2A
 igwDDrDwpm9tvzilsTAdjEH3gRcuxDRWfF259bZXbnxksVMuwzo31YraU6dBUkSc
 qPpQtbS4Op0paFG0TieBAt07TZ8Wb4KkAM86vBu31JpXZkXGyT6B6N3qe4WtpAN8
 l5qAWstBRog5JM3Q99FNDnCFG/2n93CEZjwN8FlQgkFhyhhDKF5YOhZNQpqTEbh9
 nxdo5V3OC42cx92V1CxrzkPKhnBIrSTGLg+Yb9S+vF3nWX+cBPpalr/rw5xZTrdH
 3zER+hOHvkMZpEZDiyUx5bkF9Ay2BvJkdJCSFSTq9HmzksTnEJ+0r44cO2rwqOpx
 R6KZPLTmObjCjmnMM+kbd6e/T8WEkcEotuYoocf3lep45roGAYuHErWW3+B89+4Z
 f0Y8uwPQTWrOGSRKXh2liWcHeN114Uwvb0ZyO+/0Oe7v1Id/IW7zC2XfSpY58dok
 /yRXiElow1LVLISixBBUAnwkx0M+CyQJqCS/nQpedPArLos+g4Wo3R+QnQEnOu9C
 e1cRY3qa56lre6BnE+rQ3aMNVGgfjsU4t3mSjQlCp1PbU7izvlgMHJcyErt6d5aj
 nA8VwjS+1PCODS/HkCqc
 =APdC
 -----END PGP SIGNATURE-----

Merge tag 'v0.18.20' into v0.19.x
2014-12-08 15:03:09 +01:00
Max Kellermann
41b4a63f2b decoder/ffmpeg: support FFmpeg 2.5
Version 2.5 fixed an API oddity, however it broke API compatibility,
at least with C++.  Disable the workaround when a libavformat version
is detected that is recent enough.
2014-12-08 14:25:34 +01:00
Max Kellermann
d8fc2db910 thread/Id: drop "::" prefix before pthread function names
The "::" to explicitly refer to the global namespace appeared like a
good idea in C++, but it breaks with C libraries that implement
standard functions using macros (e.g. musl).
2014-12-08 14:17:17 +01:00
Nix
811af02f56 Output: start with a null mixer.
There are code paths (mostly error cases) in which it is possible to
initialize an AudioOutput and then kill it without ever calling
audio_output_new().  In such a case, its destructor will attempt to
free a mixer that was never initialized, leading to an attempt to
take out a lock on a mutex that was similarly never initialized,
which hangs forever.

Fix by always initializing the mixer appropriately.
2014-12-01 22:14:09 +01:00
Max Kellermann
27ce80544f release v0.18.19
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUdiMjAAoJECNuiljG20USjnMP/jQl/aIEiUwbwqq1F8+0wlFh
 lX5xix5+7QuvTH2Lw5brNSRdVRsHGGeDqVcSi1zY4tgNXK/EBmS1mDVKWQO5qJd9
 v+ueDRr7xI3HFECe0J7h2Q5GGD/YkeSyjB2k7C7I7t1axukLOXbP+qVyz6/d1azZ
 SkUKKmIUD4KdJuDWy34JYYiltGl94JNyTBvC+jJV4Mbg2qd7XV6MSvJipiK6aM05
 UsEza9bF/jG2aHL/xtR+dEnNLAoFoZ/h1RqUoYw4DLEKxfip+E3MD4sEx6Sg8XSv
 v2rZQrMhl2LvJkwCjo57KrJ4YmHK0U3zg3ElDefqRsW4J10x5d3hhOINJPpHUpyZ
 T5RvoDCJ5BL+6wg0tA57338pNydSBQDV5+WjI9+vD8ahnZlFgjY+OoJDxkxtFlYz
 pLazEQbkUWlU62ZGW/dVpwgYInalNH9ZTrvelwXtGmwMfLhp01S4DHX3ipFgmMGd
 do3x/FoVRyOnFWQPotga3+ZoARqmXhfQ70DqESoajBHeLTzYBs9vh+fw6y1iVeGb
 rIBEIyMPlyuPt+2NrLflo6o0VMYB8MV3nh3P3DX8Ywavae3+k4WPGx2w/MEM34lF
 sWUDXfZeCwJ5rrXeyP/s2C9ZmJ+Bm6WlxQ0gUZXMtrfDShPBY8gHzGi4m3ooslde
 OZCIokCaATDa9Fp6CRD8
 =I9PV
 -----END PGP SIGNATURE-----

Merge tag 'v0.18.19' into v0.19.x
2014-11-26 20:02:57 +01:00
Max Kellermann
e72eef421b lib/nfs/FileReader: clean up on disconnect
Avoids crash because Close() invokes a call on a destructed
NfsConnection.
2014-11-25 14:02:15 +01:00
Max Kellermann
016063c810 lib/nfs/FileReader: move code to CancelOrClose() 2014-11-25 14:00:32 +01:00
Max Kellermann
38f19981b2 lib/nfs/FileReader: reset state in OnNfsConnectionFailed()
Avoid calling NfsConnection::RemoveLease(), because the lease has been
removed already.
2014-11-25 13:51:09 +01:00
Max Kellermann
40dd968f13 lib/nfs/FileReader: update "state" in OnNfsError()
Clean up the "state" to indicate that there is no longer any
asynchronous operation.  Fixes another NFS-related crash due to
cleanup of a non-existing asynchronous operation.
2014-11-25 13:39:42 +01:00
Max Kellermann
3cef348f30 lib/nfs/Manager: defer NfsConnection destruction
Avoids a crash that occurs when NfsConnection::OnSocketReady()
dereferences itself before returning.
2014-11-25 13:31:18 +01:00
Max Kellermann
b293b16007 lib/nfs/Connection: broadcast error before closing connection
During the NfsLease::OnNfsConnectionFailed() call, the old (defunct)
nfs_context may be used to close file handles.  Such code does not yet
exist, but will be added soon to fix other bugs.
2014-11-25 13:27:06 +01:00
Max Kellermann
f5f43db2da lib/nfs/Connection: cancel DeferredMonitor on disconnect
Fixes potential second mount attempt after the old connection to the
NFS server was shut down.
2014-11-25 13:22:25 +01:00
Max Kellermann
029555d192 lib/nfs/FileReader: include Compiler.h for "final" fallback 2014-11-25 13:18:22 +01:00
Max Kellermann
fa4d202e71 decoder/mp4v2: remove because of incompatible license
libmp4v2 is licensed under MPL 1.1, which is incompatible with GPLv2.
Unfortunately, this means that we must remove the plugin.

More information can be found in the Debian bug report:

 http://bugs.debian.org/767504
2014-11-25 13:10:52 +01:00
Max Kellermann
a8ebfd7a92 event/DeferredMonitor: include cleanup 2014-11-25 10:44:06 +01:00
Max Kellermann
a254f5a3a8 archive/zzip: fix inverted error handler
Set the Error when zzip_seek()==-1 and not on success.  Fixes a crash
after seeking.
2014-11-24 22:08:50 +01:00
Max Kellermann
951bad46e0 decoder/{dsdiff,dsf,opus}: fix deadlock while seeking 2014-11-24 08:54:30 +01:00
Max Kellermann
0709065f50 Java/File: fix include guard 2014-11-24 07:51:25 +01:00
Max Kellermann
dc03f003ac release v0.18.18
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUa62OAAoJECNuiljG20US1CkP/3YaAg76hJDaeFAyi7/10lOs
 yI8tPmpQk8S+nuclsBJeIr+9xNRsjb1ebW4tI9uBRxqMT10SF7rMCH/qAmgnS9tQ
 6M48hF0o9xegjz4x5BosEJjXtiekYN068Xi/hk+H27guVy14f6Xx7oRpdr5oI/O0
 F83D1V2+vs6FuOyn42UQQNHVlYMac5SScHoSFomnwRYWI2wb2ay4H5Dlykb5BUl0
 tTjJ2lYwN18vUoMxjmCNS+bLd7jag6FZ/PXntB1zXe22R17eAIuFZAMKaQvnQtUi
 QZjFPhpd+mBsZLfokB3belyNNb4F6qSG2W6lZrFRB+SU/LqnY2AL/dxPJD9eiufs
 5jEIOw9hNBBKo217+hkPwp5pAF50u11tKXUXbKGeR42zAO0zll/+g2afVwoqdAfD
 llPDyQyXiB3tmA1bgJD7u9gaud3UaaXoxajPb5LnmklzGxiN5u1rnoo+E5ppBvQ4
 31wPHGpzsjxEC7Xn9hErPP17jYXY1HT/xRb8XZNrFqJVZxSyjqQlDWomhCWDcvPc
 Du1PyKaQ08zgElEM5trwC9RjJxQdr0sckQcTnYC/0ksfJ7Nhh8M2yepEI/gmWbnO
 JBQ7YzpQhE9oMMH8jzVLLdC44yF6QvXcGQ3D9eUfwvPk9Z70mHlNI3Q6kbZ76U5j
 RHLp+oSaxFUXfPdciZaw
 =GO+k
 -----END PGP SIGNATURE-----

Merge tag 'v0.18.18' into v0.19.x
2014-11-18 21:38:44 +01:00
Max Kellermann
460cfba6ff QueueCommands: workaround for buggy clients that send "add /" 2014-11-18 21:31:54 +01:00
Max Kellermann
c8b93d6573 Client: assume uid==0 is local socket
A negative uid value means it's not a "local socket" (PF_LOCAL).
uid==0 means user "root" connected.
2014-11-18 20:56:27 +01:00
Max Kellermann
3f5f96ac91 event/ServerSocket: fix get_remote_uid() error value
Must return -1 on error, not 0.  0 is root.
2014-11-18 20:53:59 +01:00
Max Kellermann
7c6b991de7 decoder/opus: add MIME types audio/ogg and application/ogg 2014-11-12 15:16:34 +01:00
Florent Le Coz
7e7b403043 Construct a Null AllocatedPath if the filename conversion into UTF8 failed 2014-11-11 17:15:19 +01:00
Max Kellermann
c98cb1d6f9 decoder/opus: support chained streams 2014-11-11 11:20:18 +01:00
Max Kellermann
ba6f2b0467 decoder/opus: move code to HandleEOS() 2014-11-11 11:20:16 +01:00
Max Kellermann
23465ad985 decoder/opus: improved error logging 2014-11-11 11:20:03 +01:00
Max Kellermann
7886a14b74 decoder/opus: fix mistyped LoadEOSPacket() return value 2014-11-11 11:18:51 +01:00
Max Kellermann
466b6a23cd decoder/opus: eliminate flag "found_opus"
Check opus_decoder!=nullptr instead.
2014-11-11 08:30:11 +01:00
Max Kellermann
4a04f73434 decoder/opus: add constexpr output_buffer_frames 2014-11-11 07:45:31 +01:00
Misty De Meo
134cb6a017 Main: fix compilation on OS X using non-Apple compilers
Commit d42c0f1dc5 added an OS X-specific
method of calling mpd_main_after_fork(), which uses Grand Central
Dispatch. Since this uses a block literal, it breaks compilation on
compilers which don't support the block extension, e.g. non-Apple
compilers. This affects users on older OS X releases with GCD (which
depend on older Clang releases, or Apple GCCs, which don't support the
C++11 features MPD needs); or which don't support GCD at all (10.5 and
lower).

This patch changes the #ifdef so that the non-GCD code is used
as it was on OS X before this patch if blocks aren't available, via
checking __BLOCKS__ macro.
2014-11-11 06:22:24 +01:00
Max Kellermann
8d036c4b7c pcm/SoxrResampler: round output buffer size up
The old formula calculates the output buffer size with "regular"
rounding (to the nearest integer), however sometimes, that is
insufficient and the last sample cannot be resampled.  This causes
audible distortions.  By changing the formula to consider the worst
case (always round up), this problem is eliminated.
2014-11-10 22:52:17 +01:00
Max Kellermann
c64ad78c7b decoder/ffmpeg: support opus 2014-11-10 18:00:30 +01:00
Max Kellermann
8ff0d99092 decoder/audiofile: fix bit rate calculation 2014-11-10 09:00:50 +01:00
Max Kellermann
ff6f1655f0 input/curl: ignore ResponseBoundary() while seeking
While seeking, metadata must not be updated.  ResponseBoundary() was
added in MPD 0.19.1, but I forgot to add the IsSeeking() check there.
This caused the "seekable" flag to reset.
2014-11-10 08:45:19 +01:00
Max Kellermann
b5ba94f1de tag/Set: do AlbumArtist/Artist fallback only if AlbumArtist is not disabled
On "list albumartist", songs that have no AlbumArtist tag will use the
Artist tag.  However, if AlbumArtist is disabled via
"metadata_to_use", the TagBuilder::AddItem() call is ignored, and
PrintUniqueTag() attempts to print a nullptr string.

This commit fixes the problem by attempting the fallback only if
AlbumArtist is not disabled.
2014-11-08 19:25:01 +01:00
Max Kellermann
cbf79769d3 db/Count: include cleanup 2014-11-08 19:21:42 +01:00
Max Kellermann
125eb01e03 decoder/ffmpeg: support opus 2014-11-07 19:22:26 +01:00
Max Kellermann
ccb13205f4 db/upnp: fix valgrind warning 2014-11-07 19:12:43 +01:00
Max Kellermann
6f23e91e33 lib/upnp/ContentDirectoryService: swap uri_apply_base() parameters
When uri_apply_base() was moved from db/upnp/Util.cpp to
util/UriUtil.cpp, the parameter order was changed, however without
swapping the parameters in the ContentDirectoryService constructor.
2014-11-07 18:43:00 +01:00
Max Kellermann
1bd8a322f5 input/AsyncInputStream: set Error when seeking unseekable
Fixes crash in the "audiofile" decoder while logging the seek error.
2014-11-07 13:57:57 +01:00
Max Kellermann
362e73bea8 input/Open: expose input_domain 2014-11-07 13:57:57 +01:00
Max Kellermann
56f763a4a8 input/curl: forget Content-Length (and more) after redirect
Fixes playback of redirected streams.
2014-11-02 13:00:28 +01:00
Max Kellermann
a2eb14f3b3 AsyncInputStream: add method ClearTag() 2014-11-02 13:00:28 +01:00
Max Kellermann
05c63af7c4 InputStream: add method ClearMimeType() 2014-11-02 12:59:16 +01:00
Max Kellermann
1f59701c46 Merge branch 'v0.18.x' into v0.19.x 2014-11-02 12:27:46 +01:00
Max Kellermann
ec3191f502 input/curl: fix curl_easy_setopt() parameter types 2014-11-02 11:55:48 +01:00
Max Kellermann
32b5654a6e Decoder, Playlist: ignore URI query string for plugin detection
Use the new uri_get_suffix() overload that removes the query string.
2014-11-02 11:54:26 +01:00
Max Kellermann
674091424e util/UriUtil: add uri_get_suffix() overload that ignores query string 2014-11-02 11:53:31 +01:00
Max Kellermann
6ad336743d PlaylistFile: don't allow empty playlist name 2014-11-02 11:52:48 +01:00
Max Kellermann
c882568ccd playlist/m3u: recognize the file suffix ".m3u8" 2014-11-02 11:50:56 +01:00
Max Kellermann
f6b2899dd2 decoder/faad: remove workaround for ancient libfaad2 ABI bug
Many years ago, FAAD had a serious ABI bug: the NeAACDecInit()
prototype in its header declared the "samplerate" parameter to be
"unsigned long *", but internally, the function assumed it was
"uint32_t *" instead.  On 32 bit machines, that was no difference, but
on 64 bit, this left one portion of the return value uninitialized;
and worse, on big-endian, the wrong word was filled.  This bug had to
be worked around in MPD (commit 9c4e97a6).

A few months later, the bug was fixed in the FAAD CVS in commit 1.117
on file libfaad/decoder.c; the commit message was:

 "Use public headers internally to prevent duplicate declarations"

The commit message was too brief at best; the problem was not
duplicate declarations, but a prototype mismatch.  No mention of the
bug fix in the ChangeLog.

The MPD project never learned about this bug fix, and so MPD would
always pass a "uin32_t *" dressed up as a "unsigned long *".  Nearly 6
years later, it's about time to fix this second ABI problem.  Let's
kill the workaround!
2014-11-02 11:50:56 +01:00
Steven OBrien
bccd4ef2f7 decoder/ffmpeg: recognize MIME type audio/aacp 2014-11-02 11:50:56 +01:00
Max Kellermann
c50a0cf7bf output/roar: remove unnecessary "volatile" keyword
A mutex acts as a memory barrier, and thus "volatile" is not
necessary.
2014-11-02 11:50:56 +01:00
Max Kellermann
c37f7abb79 TagString: use g_strndup() for unterminated string
Fixes buffer overflow bug.
2014-11-02 11:48:13 +01:00
Max Kellermann
054323c2bc lib/upnp/Discovery: add missing stdlib.h include 2014-11-02 11:04:13 +01:00
Max Kellermann
a8770aa606 input/curl: fix curl_easy_setopt() parameter types 2014-11-01 14:09:30 +01:00
Max Kellermann
7d5442e103 Decoder, Playlist: ignore URI query string for plugin detection
Use the new uri_get_suffix() overload that removes the query string.
2014-11-01 13:41:18 +01:00
Max Kellermann
eab32f2e5d util/UriUtil: add uri_get_suffix() overload that ignores query string 2014-11-01 12:45:47 +01:00
NanoTech
d42c0f1dc5 Main: run the OS X native event loop after forking 2014-10-31 15:03:53 +01:00
NanoTech
6ad1e4d99a Revert "Main: run the OS X native event loop"
This reverts commit f0be48ff90
(except for the NEWS entry).

If libdispatch (GCD) is used before forking, it
can't safely be used again after forking.
2014-10-31 15:03:46 +01:00
Max Kellermann
7350144ab3 PlaylistFile: don't allow empty playlist name 2014-10-31 14:59:27 +01:00
Max Kellermann
54c591bd9d decoder/mad: fix negative replay gain values
Negating an unsigned integer does not work.
2014-10-28 22:22:30 +01:00
Max Kellermann
217d88f21f TextInputStream: don't ignore unterminated last line 2014-10-28 22:10:47 +01:00
Max Kellermann
394e3be482 playlist/m3u: recognize the file suffix ".m3u8" 2014-10-26 08:14:16 +01:00
Max Kellermann
d7f024c510 OutputThread: fall back to PCM if given DSD sample rate is not supported
Works around the "PCM conversion from f to dsd is not implemented"
error message that prevents DSD playback.
2014-10-25 22:06:08 +02:00
Max Kellermann
bc5a53574c decoder/faad: remove workaround for ancient libfaad2 ABI bug
Many years ago, FAAD had a serious ABI bug: the NeAACDecInit()
prototype in its header declared the "samplerate" parameter to be
"unsigned long *", but internally, the function assumed it was
"uint32_t *" instead.  On 32 bit machines, that was no difference, but
on 64 bit, this left one portion of the return value uninitialized;
and worse, on big-endian, the wrong word was filled.  This bug had to
be worked around in MPD (commit 9c4e97a6).

A few months later, the bug was fixed in the FAAD CVS in commit 1.117
on file libfaad/decoder.c; the commit message was:

 "Use public headers internally to prevent duplicate declarations"

The commit message was too brief at best; the problem was not
duplicate declarations, but a prototype mismatch.  No mention of the
bug fix in the ChangeLog.

The MPD project never learned about this bug fix, and so MPD would
always pass a "uin32_t *" dressed up as a "unsigned long *".  Nearly 6
years later, it's about time to fix this second ABI problem.  Let's
kill the workaround!
2014-10-25 20:42:50 +02:00
Steven OBrien
8cd17ce045 decoder/ffmpeg: recognize MIME type audio/aacp 2014-10-25 00:26:58 +02:00
Max Kellermann
c48733e34f fs/Charset: work around clang's -Wunused-const-variable
MPD_PATH_MAX_UTF8 is only used by GLib-specific code currently.
2014-10-25 00:07:25 +02:00
Max Kellermann
a7b09d3d1c OutputThread: close the output plugin after filter failure
Fixes memory leak because ao_plugin_close() never gets called.
2014-10-24 00:35:16 +02:00
Max Kellermann
8fc3768166 OutputThread: unlock mutex for CloseFilter()
Be consistent.
2014-10-24 00:29:03 +02:00
Max Kellermann
b07bddf742 output/roar: remove unnecessary "volatile" keyword
A mutex acts as a memory barrier, and thus "volatile" is not
necessary.
2014-10-23 23:29:56 +02:00
Max Kellermann
220f957cd8 pcm/ChannelsConverter: fix variable used to generate error message
Use the "_format" parameter instead of the (uninitialized) "format"
attribute.
2014-10-23 22:44:53 +02:00
Max Kellermann
8ce48d83eb pcm/FormatConverter: move check to Open()
Report unsupported format while opening the filter, not later when the
first conversion takes place.
2014-10-23 22:42:08 +02:00
Max Kellermann
200cdb6b0a pcm/PcmConvert: assign {src,dest}_format at the end
Fixes assertion failure in destructor by not assigning
{src,dest}_format when an error occurs.
2014-10-23 22:39:51 +02:00
Max Kellermann
d9fb40203a pcm/PcmConvert: make AudioFormat parameters "const" 2014-10-23 22:39:51 +02:00
Max Kellermann
493cd866f1 TextInputStream: manually shift the buffer before reading
Fixes truncated lines in m3u and cue files (regression by commit
67958f7).
2014-10-19 00:50:52 +02:00
Max Kellermann
063d369672 util/StaticFifoBuffer: make Shift() public 2014-10-19 00:49:08 +02:00
Max Kellermann
a0fae8dacc playlist/extm3u: strip first line for #EXTM3U detection 2014-10-17 20:45:18 +02:00
Max Kellermann
85301853d6 ThreadInputStream: call ThreadRead() inside the thread instead of Read()
Fixes deadlock bug in the "mms" plugin.
2014-10-11 21:59:06 +02:00
Max Kellermann
7cd53fb452 ThreadInputStream: add assertions 2014-10-11 21:57:31 +02:00
Max Kellermann
8ed4124184 util/DynamicFifoBuffer: make the "Range" type public
Export it from the protected base class.  This fixes a build failure
on Mac OS X.
2014-10-11 20:28:08 +02:00
Max Kellermann
464767c5fd db/upnp/Util: move caturl() to util/UriUtil.cxx 2014-10-10 22:43:40 +02:00
Max Kellermann
a9c3ca8606 event/IdleMonitor: remove redundant comment 2014-10-10 22:39:11 +02:00
Max Kellermann
86dd677e0c ZeroconfBonjour: use htons() instead of g_htons() 2014-10-10 22:30:38 +02:00
Max Kellermann
666f700a93 TagString: implement fix_utf8() without GLib 2014-10-10 22:11:38 +02:00
Max Kellermann
b70bf938c2 util/UTF8: add SequenceLengthUTF8() 2014-10-10 22:11:38 +02:00
Max Kellermann
d5cf41e043 util/UTF8: new library 2014-10-10 22:11:38 +02:00
Max Kellermann
b7a1954c33 TagString: return WritableBuffer<char> 2014-10-10 22:07:19 +02:00
Max Kellermann
6520589a37 TagString: use strndup() for unterminated string
Fixes buffer overflow bug.
2014-10-10 22:06:48 +02:00
Max Kellermann
f445b0178a TagString: remove ISO-Latin-1 fallback
MPD handles all strings in UTF-8 internally.  Those decoders which
read Latin-1 tags are supposed to implement the conversion, instead of
passing Latin-1 to TagBuilder::AddItem().  FixTagString() is simply
the wrong place to do that, and hard-coding Latin-1 is kind of
arbitrary.
2014-10-10 20:53:08 +02:00
Max Kellermann
f618065f7c fs/Traits: use value_type 2014-10-10 19:51:44 +02:00
nanotech
f0be48ff90 Main: run the OS X native event loop 2014-10-10 19:51:44 +02:00
Max Kellermann
bb922d577d storage/nfs: use the libnfs async API
Share the NFS connection with the NFS input plugin.
2014-10-09 08:09:08 +02:00
Max Kellermann
990809cc21 lib/nfs/Connection: reduce Error instance allocations 2014-10-09 08:08:17 +02:00
Max Kellermann
bfcc466647 lib/nfs/Glue: add assertion 2014-10-09 07:59:53 +02:00
Max Kellermann
3d2558bde6 StoragePlugin: pass EventLoop to constructor 2014-10-09 07:45:25 +02:00
Max Kellermann
e5ff85b63c storage/nfs: move code to class MemoryStorageDirectoryReader
Read all directory entries into memory and close the struct nfsdir
before returning the StorageDirectoryReader instance.  This is what
libnfs does, anyway.
2014-10-07 06:36:11 +02:00
Max Kellermann
f0bb5b84f9 storage/nfs: move code to Copy() 2014-10-07 06:35:53 +02:00
Max Kellermann
07b50f6c69 lib/nfs/Connection: add methods {Open,Read,Close}Directory() 2014-10-07 06:35:50 +02:00
Max Kellermann
61b3aaaa07 lib/nfs/Connection: add method Stat(path) 2014-10-07 06:35:46 +02:00
Max Kellermann
60512ffa09 lib/nfs/Connection: make GetEventLoop() public 2014-10-06 08:47:13 +02:00
Max Kellermann
b1a252a64d lib/nfs/Base: kludge to reduce number of NFS mounts
Creating a NfsStorage sets its own export_name as the "base".  Now
NfsFileReader can use this information to derive the export_name to be
mounted, instead of guessing.  This solves the "too many connection"
problem on the NFS server while updating the database.
2014-10-05 07:41:50 +02:00
Max Kellermann
6e7a398263 PlaylistStream: use OpenLocalInputStream() 2014-10-02 22:03:02 +02:00
Max Kellermann
44d2d9b1e8 PlaylistStream: pass Path instance to playlist_open_path()
Convert filesystem charset to UTF-8 for playlist_list_open_uri().
This fixes one of many remaining charset bugs.
2014-10-02 22:02:11 +02:00
Max Kellermann
8302ed44aa archive/bzip2: use OpenLocalInputStream() 2014-10-02 22:00:42 +02:00
Max Kellermann
7e12aea1d8 input/Open: use OpenLocalInputStream()
Make the "open" method of plugins "file" and "archive" dummy methods
that always fail.  Instead, let InputStream::Open() hard-code access
to these two plugins by using OpenLocalInputStream().  This allows
simplifyin the algorithm for falling back to probing archive plugins.
2014-10-02 21:50:14 +02:00