Commit Graph

7112 Commits

Author SHA1 Message Date
Max Kellermann
b330aa8dd5 db/upnp: remove unnecessary empty string checks from CharacterData() 2014-01-10 22:59:46 +01:00
Max Kellermann
1b8053a618 db/upnp/Directory: simplify checkobjok() 2014-01-10 22:59:28 +01:00
Max Kellermann
70e5ab3fde db/upnp/Directory: don't log unknown items 2014-01-10 22:59:16 +01:00
Max Kellermann
f4490f6918 db/upnp/Directory: eliminate the "attributes" std::map
Look up attributes in the "atts" array.  Reduce bloat.
2014-01-10 22:59:01 +01:00
Max Kellermann
dadd987bf4 db/upnp/Directory: move "res" attributes to array
Reduce bloat.
2014-01-10 22:58:37 +01:00
Max Kellermann
a1ced29279 db/upnp: use nullptr-terminated array
Reduce bloat.
2014-01-10 22:58:23 +01:00
Max Kellermann
791d6c1336 db/upnp/Directory: eliminate struct StackEl, use std::string
Reduces bloat.
2014-01-10 22:57:57 +01:00
Max Kellermann
10abb07960 db/upnp/Directory: make "attributes" a local variable
We only need it inside StartElement().  Reduces bloat.
2014-01-10 22:57:46 +01:00
Max Kellermann
040a5ddad5 db/upnp/Directory: move "res" tag handler to StartElement()
No need to handle this in EndElement() - in StartElement(), we already
have all we need.
2014-01-10 22:57:22 +01:00
Max Kellermann
e7eb04954d db/upnp/Directory: don't use std::map to parse upnp:class
Reduce excessive bloat.
2014-01-10 22:57:16 +01:00
Max Kellermann
09b00fa4e3 db/upnp/Object: use strictly-typed enums
At the same time, rename the enum types and the class attributes, and
add an "UNKNOWN" type/class.  The latter avoids the "-1" hack.
2014-01-10 22:56:52 +01:00
Max Kellermann
74842fd6d4 db/upnp: getprop() returns const char *
Return the return value, instead returning it in a reference
parameter.  Reduces bloat by reducing unnecessary std::string usage.
2014-01-10 22:56:45 +01:00
Max Kellermann
f23b47ba17 Expat: attributes come in name/value pairs (bug fix)
I wrongfully assumed that each array element is a name and a value
concatenated.
2014-01-10 22:56:28 +01:00
Max Kellermann
15eedfbb12 db/upnp: don't set mtime, start_ms, end_ms
Not necessary or useful.
2014-01-10 09:01:28 +01:00
Max Kellermann
cfc25e08dc db/upnp: use TagTable in upnpItemToSong()
Reduces bloat by eliminating one std::map.
2014-01-10 08:57:31 +01:00
Jean-Francois Dockes
406452f019 UPnP database plugin
[mk: renamed source files, applied coding style, reduced bloat, using
MPD's threading library, using MPD's error reporting and logging
library and refactoring, fixed lots of bugs]
2014-01-09 20:56:00 +01:00
Max Kellermann
12b139beaf ExpatParser: add Parse() overload with buffer 2014-01-09 20:56:00 +01:00
Max Kellermann
2ed1c22227 ExpatParser: add helper class CommonExpatParser 2014-01-09 20:56:00 +01:00
Max Kellermann
eb23ef1747 event/Loop: allow AddTimer() after Run() has returned
Kludge for libavahi-client quirk.
2014-01-09 20:56:00 +01:00
Max Kellermann
970b10d01b tag/TagTable: add lookup TagType -> name 2014-01-09 19:01:03 +01:00
Max Kellermann
61b938d6fa event/Loop: allow scheduling events before Run()
Add the debug-only flag "virgin" which gets checked by assert()
calls.  Fixes assertion failures when using zeroconf/avahi.
2014-01-09 17:52:55 +01:00
Max Kellermann
0c34555b02 Directory: remove method Free() 2014-01-09 13:21:56 +01:00
Max Kellermann
83a988e2e4 db/proxy: allocate Directory instance on the stack 2014-01-09 13:21:09 +01:00
Max Kellermann
91efe1cb5a Directory: convert to fixed-size struct
Using a variable-size struct with embedded string is not worth the
trouble here.  There are not so many Directory objects.
2014-01-09 13:14:14 +01:00
Max Kellermann
735241f049 Timer: remove unused method Synchronize() 2014-01-09 12:56:57 +01:00
Max Kellermann
dd82370a80 playlist/{asx,rss,xspf}: use Expat instead of GLib to parse XML 2014-01-09 12:19:52 +01:00
Max Kellermann
dab052e53d playlist/asx: make variables more local 2014-01-09 12:18:13 +01:00
Max Kellermann
322b061632 DetachedSong: fork of struct Song
From now on, struct Song will be used by the database only, and
DetachedSong will be used by everybody else.  DetachedSong is easier
to use, but Song has lower overhead.
2014-01-09 09:05:58 +01:00
Max Kellermann
8f9ba96c59 SongUpdate: move code to handle_lsinfo()
Don't create a temporary Song object in handle_lsinfo().  Instead,
print all tags while parsing the remote file.
2014-01-08 23:35:37 +01:00
Max Kellermann
10406c73b3 SongSave: make variables more local 2014-01-08 23:10:24 +01:00
Max Kellermann
139122c57f Merge branch 'v0.18.x' 2014-01-08 22:14:12 +01:00
Max Kellermann
fdd76b3461 decoder/faad: fix memory leak 2014-01-08 22:11:00 +01:00
Max Kellermann
e490e5d0ab playlist/pls: don't free stack buffer 2014-01-08 19:50:44 +01:00
Max Kellermann
3b568b0943 playlist/pls: make variables more local 2014-01-08 19:50:10 +01:00
Max Kellermann
b2e1b38864 playlist/pls: convert "while" loop to "for" loop 2014-01-08 19:50:05 +01:00
Max Kellermann
5c6fe97b35 playlist/pls: simplify error handler
Don't pass a GError** to g_key_file_get_X().  We don't need to dispose
something we didn't request in the first place.
2014-01-08 19:49:34 +01:00
Max Kellermann
2071070f39 DespotifyUtils: return Tag, not pointer 2014-01-08 19:49:27 +01:00
Max Kellermann
89a78a5f3c DespotifyUtils: pass const ds_track reference 2014-01-08 19:49:21 +01:00
Max Kellermann
bc23a6bb05 tag/TagBuilder: overload Commit() returning a Tag object 2014-01-08 19:49:08 +01:00
Max Kellermann
ac1983eae3 tag/TagBuilder: rename Commit() to CommitNew() 2014-01-08 19:48:55 +01:00
Steven O'Brien
33c5fc95b4 input/AlsaInputPlugin: remove unnecessary alsa s/w param setting to fix high CPU load issue 2014-01-08 14:00:42 +01:00
Max Kellermann
6a953394f4 SongSticker: use Song references 2014-01-08 00:41:08 +01:00
Max Kellermann
c152a88ff6 PlayerThread: use Song references 2014-01-08 00:36:59 +01:00
Max Kellermann
cbf57e7421 DecoderThread: use Song references 2014-01-08 00:35:28 +01:00
Max Kellermann
27ca0db7a6 util/Alloc: new library replacing GLib's g_malloc() 2014-01-07 23:35:18 +01:00
Max Kellermann
49f34fbf68 DecoderBuffer: use NewVarSize() 2014-01-07 23:31:26 +01:00
Max Kellermann
fe6094a822 tag/TagPool: use NewVarSize() to allocate TagPoolSlot 2014-01-07 23:24:59 +01:00
Max Kellermann
8a30c7992d tag/TagPool: rename struct slot to TagPoolSlot 2014-01-07 23:12:24 +01:00
Max Kellermann
70eb9335bd tag/TagPool: use gcc_packed instead of mpd_packed
By accident, this declared a global variable instead of adding the
"packed" attribute.
2014-01-07 23:11:00 +01:00
Max Kellermann
da80f91e1c Directory: make some code generic, move to VarSize.hxx 2014-01-07 23:10:56 +01:00
Max Kellermann
cc60d193ce Directory: use g_malloc() instead of g_malloc0()
Explicit attribute initialization.
2014-01-07 23:10:56 +01:00
Max Kellermann
0f99410ba1 playlist/soundcloud: parse URI without copying it 2014-01-07 10:21:42 +01:00
Max Kellermann
442dadd6fe playlist/soundcloud: change scheme check to assertion
The MPD core takes care for checking the scheme.
2014-01-07 09:40:31 +01:00
Max Kellermann
da9dd58f34 playlist/soundcloud: eliminate nullptr checks before g_free() 2014-01-07 09:27:50 +01:00
Max Kellermann
bd01d80ffc pcm/Utils: remove unused function pcm_end_pointer() 2014-01-07 00:46:47 +01:00
Max Kellermann
7eda72d440 pcm/Volume: use number of samples instead of end pointer 2014-01-07 00:42:02 +01:00
Max Kellermann
c75339edcc pcm/Format: change parameters/return values to ConstBuffer 2014-01-06 23:08:49 +01:00
Max Kellermann
b0b7244b3a pcm/Format: use number of samples instead of end pointer 2014-01-06 22:42:33 +01:00
Max Kellermann
a9e849ff4f DecoderBuffer: _read() returns ConstBuffer object 2014-01-06 22:17:30 +01:00
Max Kellermann
4c95a4d7c6 DecoderBuffer: add "pure" attributes 2014-01-06 22:16:56 +01:00
Max Kellermann
eac9fabd48 DecoderBuffer: add method _clear() 2014-01-06 21:59:43 +01:00
Max Kellermann
e2a08fa824 decoder/faad: make variables more local 2014-01-06 21:57:40 +01:00
Max Kellermann
d403749d09 decoder/faad: eliminate local variable "ret" 2014-01-06 21:57:40 +01:00
Max Kellermann
582c2105a9 event/Loop: cancel the WakeFD monitor in destructor 2014-01-06 21:57:40 +01:00
Steven O'Brien
f39a34ccfa input/AlsaInputPlugin.cxx: use I/O thread to poll for available data
[mk: modified to use MultiSocketMonitor instead of SocketMonitor]
2014-01-06 18:27:44 +01:00
Max Kellermann
08f5b9f1f9 event/MultiSocketMonitor: add method ClearSocketList() 2014-01-06 18:27:26 +01:00
Max Kellermann
793962c5b8 event/SocketMonitor: don't close the socket automatically
Users now have to call Close() explicitly.  This simplifies using the
class, as most users have automatic socket management already, and
Steal() had to be used often.
2014-01-06 18:26:55 +01:00
Max Kellermann
0d20130d07 util/Cast: new utility library 2014-01-06 18:21:45 +01:00
Max Kellermann
617090cfda event/IdleMonitor: cancel in destructor only if active
Debug-mode workaround for bogus assertion failure.
2014-01-06 18:21:45 +01:00
Max Kellermann
a9e604d51d event/MultiSocketMonitor: API documentation 2014-01-06 08:59:27 +01:00
Max Kellermann
e599b86424 event/Loop: try to avoid the WakeFD when adding DeferredMonitor
Add a flag that indicates whether the EventLoop is currently "busy".
As long as that flag is set, it does not need to be woken up - we can
simply add the DeferredMonitor to the list, and it will be caught by
EventLoop very soon.  This eliminates nearly all of the
DeferredMonitor overhead when compared to IdleMonitor, rendering
IdleMonitor mostly obsolete.
2014-01-05 02:15:34 +01:00
Max Kellermann
da9e584921 event/Loop: combine multiple WakeFD::Write() calls
Reduce DeferredMonitor overhead.
2014-01-05 02:15:10 +01:00
Max Kellermann
e9d764d7ad event/Loop: add attribute "again"
Improved support for added events.
2014-01-05 02:15:01 +01:00
Max Kellermann
6268955778 event/Loop: add thread-safety assertions 2014-01-05 02:14:31 +01:00
Max Kellermann
4ddfc6e9a2 output/httpd: move the clients.clear() call to the IOThread
This call is not thread-safe.
2014-01-05 02:13:35 +01:00
Max Kellermann
dcbc05a9cd output/httpd: import GetEventLoop() 2014-01-05 02:13:21 +01:00
Max Kellermann
4c705334fa ClientList: use "delete" instead of Client::Close()
Client::Close() installs a TimeoutMonitor, which is not something we
should do during shutdown.
2014-01-05 02:07:49 +01:00
Max Kellermann
c12da599b9 event/Loop: remove obsolete assertion 2014-01-05 01:41:03 +01:00
Max Kellermann
f685a48008 event/Loop: move code to HandleDeferred() 2014-01-05 01:35:12 +01:00
Max Kellermann
7c15e41da5 event/MultiSocketMonitor: add missing <algorithm> include
For std::find_if().
2014-01-05 01:35:12 +01:00
Max Kellermann
7b540f0226 event/MultiSocketMonitor: add method ReplaceSocketList()
Move code from AlsaMixerPlugin.
2014-01-05 01:28:36 +01:00
Max Kellermann
e29c22e662 event/MultiSocketMonitor: include cleanup 2014-01-05 00:39:29 +01:00
Max Kellermann
f0d3b47ad8 event/Loop: remove the GLib implementation
Now that the remaining known bugs in poll() implementation are fixed,
we can go on without the GLib implementation.
2014-01-04 19:31:23 +01:00
Max Kellermann
bfe7533546 output/httpd: move Bind()/Unbind() to the IOThread
Fixes more thread-safety bugs.
2014-01-04 19:29:51 +01:00
Max Kellermann
880bf17dae event/poll: eliminate one vector::size() call 2014-01-04 19:10:21 +01:00
Max Kellermann
c9da3363a0 output/httpd: move all broadcast operations to the IOThread
Add a Page queue to class HttpdOutput, and use DeferredMonitor to
flush this queue inside the IOThread.  This fixes a thread-safety
issue: much of EventLoop is not thread-safe, and the httpd plugin
ignored that problem.
2014-01-04 18:22:55 +01:00
Max Kellermann
9bd4ed3e60 output/httpd: use the IOThread
Do all I/O in the IOThread and not in the main thread.  This solves an
upcoming deadlock problem.
2014-01-04 18:21:40 +01:00
Max Kellermann
68fcc19565 output/httpd: move queue size check to HttpdClient::PushPage()
Don't let the server care for client problems.
2014-01-04 17:42:03 +01:00
Max Kellermann
8e4efd071e output/httpd: wrap the std::list in std::queue 2014-01-04 17:12:59 +01:00
Max Kellermann
f2ad9f6fad output/httpd: merge duplicate code to ClearQueue() 2014-01-04 17:11:22 +01:00
Max Kellermann
968c5eb767 output/httpd: keep track of queue size
Don't iterate the std::list each time.
2014-01-04 17:06:05 +01:00
Max Kellermann
19424e95db event/Loop: remove bogus "!quit" assertion
Commit 1f11959 allowed modifying the "quit" attribute from any thread,
and thus the assertion may fail spuriously.  This assertion is too
strict for the relaxed use of "quit".  Let's remove it and move the
"quit" check to before the SockedMonitor::Dispatch() call.
2014-01-04 17:06:05 +01:00
Max Kellermann
0f9ef2506f event/Loop: remove unused method AddCall() 2014-01-04 16:00:45 +01:00
Max Kellermann
1f1195975f event/Loop: non-recursive Break() implementation
Simply set the "quit" flag and wake up the thread.  This works even if
we're inside this thread.  Setting "quit" to a new value without mutex
protection is usually not safe, but good enough here.
2014-01-04 15:59:00 +01:00
Max Kellermann
87fce8ef27 mixer/alsa: use DeferredMonitor to update file descriptors
EventLoop::AddCall() and EventLoop::AddIdle() are unsafe, because we
can't cancel those calls.
2014-01-04 15:58:59 +01:00
Max Kellermann
d2a4f64fd6 event/BlockingCall: always use DeferredMonitor internally
There is no advantage of using EventLoop::AddCall(), now that
DeferredMonitor is thread-safe.
2014-01-04 15:58:59 +01:00
Max Kellermann
a357d84dce event/DeferredMonitor: make fully thread-safe
Instead of creating a new eventfd for each DeferredMonitor instance,
reuse EventLoop's eventfd, and add a std::list to EventLoop that
manages the list of pending DeferredMonitors.  This std::list is
protected by the same mutex as the "calls" list.

The bottom line is: reduced overhead because the per-instance eventfd
was eliminated, slightly added overhead due to Mutex usage (but
negligible), and we're thread-safe now.

This subsystem is now good enough to replace EventLoop::AddCall().
2014-01-04 15:58:59 +01:00
James McGlashan (DarkFox)
48c96bbaea Added application key for soundcloud plugin 2014-01-04 14:01:17 +01:00
James McGlashan (DarkFox)
1ee3df6976 Added user and search paramaters for SoundCloud plugin 2014-01-04 13:36:24 +01:00
James McGlashan (DarkFox)
d4dea53ae9 http -> https for SoundCloud plugin 2014-01-02 12:29:45 +01:00
Max Kellermann
d477a9222e output/httpd: change "struct" to "class" 2013-12-31 17:04:40 +01:00
Max Kellermann
69a9d29190 output/httpd: move code to methods Delay(), Play(), Cancel() 2013-12-31 17:01:08 +01:00
Max Kellermann
e2425592b6 output/httpd: move Cast() into the class 2013-12-31 16:59:24 +01:00
Max Kellermann
964b2661d8 output/httpd: add methods Init(), Finish() 2013-12-31 16:55:26 +01:00
Max Kellermann
8b65b524d5 output/httpd: use reference instead of pointer 2013-12-31 16:32:33 +01:00
Max Kellermann
f1ac2cd336 output/httpd: make the HttpdClient base class "private" 2013-12-31 16:24:51 +01:00
Max Kellermann
e73d0df2b6 event/*Monitor: document as not being thread-safe 2013-12-31 15:59:41 +01:00
Max Kellermann
af3f483924 event/Loop: document that AddCall() is thread-safe 2013-12-31 15:31:59 +01:00
Max Kellermann
809b0eb1f5 command: "lsinfo" and "readcomments" allowed for remote files 2013-12-29 18:25:32 +01:00
Max Kellermann
b5f3bfce92 SongUpdate: read tags from songs in an archive
Add the TagStream.cxx library, similar to TagFile.cxx, and use it to
load tags from song files inside archives.
2013-12-29 18:15:30 +01:00
Max Kellermann
aeb2baa495 InputStream: add static method OpenReady()
Merge some duplicate code.
2013-12-29 18:08:49 +01:00
Max Kellermann
afc70c120e util/UriUtil: uri_get_suffix() fails if name begins with dot
A file called ".jpg" is not a JPEG file with an empty name; it is
merely a hidden file.
2013-12-29 17:40:51 +01:00
Max Kellermann
ea9aff1d3f TagFile: rewind the stream before trying the next plugin
Got lost in commit c97685fe
2013-12-29 17:09:59 +01:00
Max Kellermann
cecae419fb DecoderList: add "pure" attribute 2013-12-29 17:06:59 +01:00
Max Kellermann
df4db50904 DecoderList: add function decoder_plugins_supports_suffix()
Replaces decoder_plugin_from_suffix().
2013-12-29 16:59:57 +01:00
Max Kellermann
decc4002a0 DecoderThread: use decoder_plugins_try()
.. instead of decoder_plugin_from_suffix().  This reduces overhead by
walking the array only once.
2013-12-29 16:51:18 +01:00
Max Kellermann
5bb563e3bc UpdateContainer: pass suffix instead of DecoderPlugin
Instead of using the first DecoderPlugin that supports the suffix, use
the first one that actually implements the "container_scan" method.
2013-12-29 16:46:02 +01:00
Max Kellermann
9be82891b0 TagFile: pass reference instead of pointer 2013-12-29 16:24:04 +01:00
Max Kellermann
c97685fe6c TagFile: use decoder_plugins_try()
.. instead of decoder_plugin_from_suffix().  This reduces overhead by
walking the array only once.
2013-12-29 16:13:11 +01:00
Max Kellermann
358b671033 DecoderList: remove unused function decoder_plugin_from_mime_type() 2013-12-29 15:53:55 +01:00
Max Kellermann
92a4bf4441 Merge branch 'v0.18.x' 2013-12-29 14:18:19 +01:00
Max Kellermann
e30b356eb0 daemon: no initgroups() when already running as the configured user
We can assume that initgroups() would be a no-op in that case, however
initgroups() is not allowed for unprivileged users anyway.
2013-12-29 13:59:05 +01:00
Max Kellermann
09a0803116 Daemon: fix typo in comment 2013-12-29 13:59:05 +01:00
Max Kellermann
20ffedc745 Daemon: simplify nested "if" 2013-12-29 13:57:12 +01:00
Max Kellermann
0b1ad27ba8 Daemon: fix typo in cast 2013-12-29 13:47:29 +01:00
Max Kellermann
5465647c2e input/smbclient: new input plugin 2013-12-29 01:25:27 +01:00
Max Kellermann
a2baeed329 ls: add "pure" attribute 2013-12-29 01:25:27 +01:00
Max Kellermann
92aa464edb pcm/Volume: remove unused function pcm_volume_dither() 2013-12-28 18:39:26 +01:00
Max Kellermann
da29298d4d pcm/PcmMix: improved dithering
Use the existing PcmDither library.
2013-12-28 18:30:27 +01:00
Max Kellermann
afcf0795c4 pcm/Volume: improved dithering
Instead of just adding a rectangular random value before shifting back
to the normal scale, use the existing PcmDither library.
2013-12-28 18:30:24 +01:00
Max Kellermann
394e2815db pcm/PcmDither: inline Dither24To16() and Dither32To16() 2013-12-28 18:30:13 +01:00
Max Kellermann
f3bbe4bb1f pcm/Volume: remove optimized i386 assembly
This code is unable to dither.  Until we implement that, let's remove
the code for now.  i386 isn't relevant anymore anyway.
2013-12-28 17:24:54 +01:00
Max Kellermann
2a3a18a283 pcm/Traits: use 32 bit integer for S8 long_type
16 bit is not enough for volume calculations.
2013-12-25 12:28:18 +01:00
Max Kellermann
431c80f4f0 pcm/Dither: add API documentation 2013-12-24 23:45:38 +01:00
Max Kellermann
9ac18c39a1 pcm/Dither: move shift from DitherConvert() to Dither()
All callers need this shift, so let's move it to the basic method.
2013-12-24 23:39:29 +01:00
Max Kellermann
d1b7473418 pcm/Dither: rename DitherShift() to DitherConvert() 2013-12-24 23:38:11 +01:00
Max Kellermann
64e898f6db release v0.18.6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.15 (GNU/Linux)
 
 iQIcBAABAgAGBQJSuWnsAAoJECNuiljG20US3qwP/0WGxzRFU2/dLzX6KG5/n+8R
 LqVeX7Ap7vLncA2UQQ2BiddPtF0u9lJOnex64pYCkwwpr4JBmkBa6kTKVGbbXDv5
 /tuHeUJk/aWhBJ8Qz/rxmNFBW6tNGlhf+7FVt8vHQqvHn7tWWKRlsQNk6Pd4gGM/
 UiMyuA8EtfTJZACPRRZK26H7g7EKIjsGt6vwiuWAh3MxGHWL5R2chuP5Mapi1U4U
 Qa1YOUAHlChRxGT+LmNMyKlgq+mqltbKQj+pOLPFuT6Q6BqgZp2Ept5Svod/JamC
 yCFRGWYsmRxZ0ZOhtRZACfm/yNzyIhkkvgW8FqM6tINOPrwL2MwAJVMVH3DZM7Aj
 /8ltz0OH2s9x9sUfOtxQkK/3bJpBwaDnl+dFQtGIFwigvYLR2Jv2Bl1zQO6+zICu
 bdbJS+IcOrElxTnxfir0CVEDysifUQ7/ZSQkwDqpF+RI8E07ZMZZLmXk3S2yX6Fx
 6dCwdfIsBAotF7RYsdn4cmRaSEx6Ze+aQr0l5yLh+5sKPEdDRSMrBEnCgPGU94ub
 VNl3Cp3dtq5kuSfJ90Mk0QzwVd/kCdKZKBMcTX2zv38NLcX0LCSylM4K9yCi+GR2
 gvgAJq9cmbmTEN3+grVdApNx0sqNFrD6pB27KhUKWD0VYypPu7yPPptkOWzSldbz
 8JGa8lryMbRmgiXVyivp
 =Z823
 -----END PGP SIGNATURE-----

Merge tag 'release-0.18.6'
2013-12-24 12:20:24 +01:00
Max Kellermann
91fed47648 PlayerThread: log the last song that was played 2013-12-24 11:58:10 +01:00
Max Kellermann
c05691b546 OutputControl: update both ReplayGainFilters
The "mode" of the second ReplayGainFilter was never set, and thus
replay gain was never applied to the new song during cross-fade.
2013-12-24 11:53:21 +01:00
Max Kellermann
1732166328 OutputThread: handle failing ReplayGainFilter::Open()
Since opening the PcmVolume object can now fail, this case must be
handled.
2013-12-24 10:52:33 +01:00
Max Kellermann
8edde7a4b3 pcm/Volume: convert to class
Prepare for adding state.
2013-12-23 10:58:37 +01:00
Max Kellermann
d11a0c9f14 pcm/Volume: apply volume into destination buffer 2013-12-23 10:55:29 +01:00
Max Kellermann
7be2abe6b5 pcm/Volume: convert i386 code to template specialization 2013-12-23 10:35:35 +01:00
Max Kellermann
4a62cd4ad8 pcm/Volume: move code to template pcm_volume_sample() 2013-12-23 10:35:23 +01:00
Max Kellermann
6d21b9448a pcm/PcmVolume: rename to Volume.cxx 2013-12-23 10:35:21 +01:00
Max Kellermann
2d1a3073f6 pcm/PcmConvert: move the Domain instance to Domain.cxx
Rename pcm_convert_domain to pcm_domain.  Move it out so we can use it
without depending on the whole PcmConvert library.
2013-12-23 10:35:19 +01:00
Max Kellermann
d7b9886387 ConfigData: initialise "used" in second constructor 2013-12-23 10:31:29 +01:00
Max Kellermann
1543e529f1 pcm/Dither: convert remaining methods to templates
Use the SampleTraits template and let the compiler generate a special
case for S32 instead of reusing S24_P32.
2013-12-22 22:18:06 +01:00
Max Kellermann
4043f320fe pcm/Dither: generic sample dithering using template 2013-12-22 22:06:25 +01:00
Max Kellermann
32b834aa04 pcm/Traits: include stddef.h for size_t 2013-12-22 22:06:25 +01:00
Max Kellermann
b43ec3d6f0 pcm/Traits: add MIN and MAX
Move from PcmClamp().
2013-12-22 21:32:25 +01:00
Max Kellermann
316a25dead pcm/Volume: add constant PCM_VOLUME_BITS 2013-12-22 21:31:17 +01:00
Max Kellermann
bfe020e06c pcm/Volume: make PCM_VOLUME_1 a "constexpr" 2013-12-22 21:20:40 +01:00
Max Kellermann
5aae560683 pcm/Prng: make pcm_prng() inline 2013-12-22 21:20:38 +01:00
Max Kellermann
86e72ffefb util/Clamp: generic Clamp() function 2013-12-22 21:08:06 +01:00
Max Kellermann
6416198e9f event/PollGroupPoll: include stddef.h instead of string.h 2013-12-21 21:21:25 +01:00
Max Kellermann
3c4cd9d08b input/alsa: fix build with gcc 4.6 2013-12-21 21:21:25 +01:00
Steven O'Brien
6b3b8c6f2e fix FfmpegDecoderPlugin to use relative timestamps 2013-12-20 22:28:33 +01:00
Steven O'Brien
35f85ddd86 add draft ALSA input plugin
I've created an elementary input plugin that plays sound from the
soundcard, so you can use MPD to listen to anything connected to the
line-in jack, or to Video4Linux FM radio cards that send audio through
the soundcard.  There has been a small number of posts here in the
past requesting line-in input, so here is a first, simplistic stab at
it.

The patch adds a new sheme, alsa://, which causes mpd to play data
read directly from a souncdard.  It defaults to hw:0,0, but you can
pass any ALSA device name in the URI.  So, using mpc for example:

 mpc add alsa://
 mpc play

will play from device hw:0,0.

To use a diffferent device:

 mpc add alsa://hw:1,0
2013-12-19 23:25:50 +01:00
Max Kellermann
45ad7696fe output/osx: fix typo 2013-12-19 12:46:21 +01:00
Max Kellermann
d86cd4e4b4 util/fifo_buffer: remove obsolete library 2013-12-19 12:17:09 +01:00
Max Kellermann
0e84d71559 output/osx: use DynamicFifoBuffer instead of struct fifo_buffer 2013-12-19 12:16:29 +01:00
Max Kellermann
a191db84f2 util/Error: add missing <algorithm> include
For std::move().
2013-12-19 10:58:20 +01:00
Max Kellermann
52dca859c7 util/PeakBuffer: use IsEmpty() instead of IsNull()
The DynamicFifoBuffer methods never return nullptr when the buffer is
empty or full; instead, they return an empty buffer.  This bug caused
an endless loop.
2013-12-19 10:30:26 +01:00
Michal Smucr
e4d69f38b0 riff: recognize upper-case "ID3" chunk name
Some tagging libraries (eg. TagLib) produce that variant.
2013-12-19 09:35:54 +01:00
Max Kellermann
97fc001180 input/cdio: fix typo in #include path
Broken by commit 3b0fea5f
2013-12-17 08:58:00 +01:00
Max Kellermann
f544316314 util/{Domain,Error}: relicense to BSD 2-clause 2013-12-16 22:42:01 +01:00
Max Kellermann
ecdebb315f util/PeakBuffer: use DynamicFifoBuffer instead of struct fifo_buffer
Switch to the C++ version.
2013-12-15 23:07:08 +01:00
Max Kellermann
1f523be72d util/PeakBuffer: return ConstBuffer<void> 2013-12-15 23:07:08 +01:00
Max Kellermann
f2a20a0a80 util/WritableBuffer: add cast methods 2013-12-15 23:01:06 +01:00
Max Kellermann
e5a2efaa65 util/WritableBuffer: fix indent 2013-12-15 22:58:32 +01:00
Max Kellermann
c44cb3246d util/DynamicFifoBuffer: make constructor "explicit" 2013-12-15 22:35:21 +01:00
Max Kellermann
9cfd9d7ce0 Merge branch 'v0.18.x' 2013-12-15 19:17:40 +01:00
Max Kellermann
42a09ff17a mixer/alsa: fix deadlock
This deadlock was a regression by commit 8e38b4f8.  Since we currently
can't resolve this, let's revert the commit, and add a GLib specific
workaround for the build failure.
2013-12-15 19:07:25 +01:00
Max Kellermann
d5dfe7d457 configure.ac: add option "--disable-glib"
Allows building without GLib.  This fails to compile currently,
because GLib is still used in the MPD core.
2013-12-15 18:43:12 +01:00
Max Kellermann
0db0b4e302 Daemon: use strdup() instead of g_strdup() 2013-12-15 18:43:12 +01:00
Max Kellermann
635d6a19ef util/Tokenizer, ...: include cleanup 2013-12-15 18:33:26 +01:00
Max Kellermann
777844ae0c system/SocketError, ...: use strerror() instead of g_strerror()
Avoid GLib.
2013-12-15 18:32:07 +01:00
Max Kellermann
a10a4ad900 LogInit: move backend code to LogBackend.cxx 2013-12-15 18:27:52 +01:00
Max Kellermann
c330d694c7 Log: move Log() to LogBackend.cxx
Prepare for GLib removal.
2013-12-15 17:32:41 +01:00
Max Kellermann
73555f9088 Log: move enum LogLevel to LogLevel.hxx 2013-12-15 17:23:45 +01:00
Max Kellermann
e1ec65bd53 UriUtil: add function uri_get_scheme()
Replaces g_uri_parse_scheme().
2013-12-15 17:06:10 +01:00
Max Kellermann
65b8e52d80 output/alsa: use new[] instead of g_malloc() 2013-12-14 22:17:19 +01:00
Max Kellermann
4b7a418e28 playlist/soundcloud: fix coding style 2013-12-14 22:09:27 +01:00
Max Kellermann
73d917b76e playlist/soundcloud: make variables more local 2013-12-14 22:08:45 +01:00
Max Kellermann
527a6003e2 input/despotify: don't log "eof" flag after setting it 2013-12-14 13:58:28 +01:00
Max Kellermann
26c731a382 input/despotify: convert to class 2013-12-14 13:49:56 +01:00
Max Kellermann
8297563978 decoder/flac: simplify the comment parsers 2013-12-14 13:44:57 +01:00
Max Kellermann
1da0526072 decoder/flac: VorbisComment_Entry is null-terminated
Don't duplicate the buffer just to null-terminate the string.
According to libFLAC API documentation, the string is already
null-terminated.
2013-12-14 13:44:57 +01:00
Max Kellermann
635a67afac util/SplitString: new utility class
To replace g_strdup().
2013-12-14 12:58:26 +01:00
Max Kellermann
c7e7c819a2 decoder/vorbis: remove useless cast 2013-12-14 12:53:59 +01:00
Max Kellermann
fbf677d9b2 decoder/mad: use new[] instead of g_malloc() 2013-12-14 12:50:51 +01:00
Max Kellermann
d37b788ea8 DecoderAPI: add function decoder_read_full()
Move code from the "mad" plugin.
2013-12-14 12:43:06 +01:00
Max Kellermann
cb336ff666 DecoderAPI: add function decoder_skip()
Move code from the "mad" plugin.
2013-12-14 12:40:43 +01:00
Max Kellermann
c7b1038a9d Merge branch 'v0.18.x' 2013-12-14 12:37:16 +01:00
Max Kellermann
d43aa12987 Tag: swap "base" and "add" in method Merge()
Fixes broken CUE sheet song tags (regression by commmit 7e8d254b).
2013-12-13 15:53:58 +01:00
Max Kellermann
8e38b4f83c mixer/alsa: use BlockingCall() instead of EventLoop::AddCall()
This is safer, and works without epoll().  Fixes a build failure with
uClibc, which does not support epoll().
2013-12-13 14:35:36 +01:00
mobidyc
96fa69ff6b SongUpdate: accept files without metadata
If the file was recognized by a decoder plugin, accept it - don't
require metadata.
2013-12-10 19:34:35 +01:00
Max Kellermann
39d94bd3ea TagFile: add return value API documentation 2013-12-10 19:32:26 +01:00
Lukas Stabe
695ca29274 output/osx: fix build failure 2013-12-10 19:19:31 +01:00
Denis Krjuchkov
ca69ad8beb CommandLine: refactor config search, use standard directory API 2013-12-08 17:25:20 +06:00
Denis Krjuchkov
e42637226f Main: use standard directory API 2013-12-08 17:25:19 +06:00
Denis Krjuchkov
ae25582178 ConfigPath: use standard directory API 2013-12-08 17:25:19 +06:00
Denis Krjuchkov
5d85792178 fs: implemented standard directories API 2013-12-08 17:24:43 +06:00
Denis Krjuchkov
acba9c0f61 TextFile: move to fs subsystem 2013-12-08 04:15:27 +06:00
Max Kellermann
ad7302a032 util/DynamicFifoBuffer: new class replacing growing_fifo 2013-12-05 11:49:21 +01:00
Denis Krjuchkov
38afc89407 fs/FileSystem.hxx: don't define CheckAccess() with mode on Windows 2013-12-05 15:05:01 +06:00
Denis Krjuchkov
c161bb287c db/SimpleDatabasePlugin.cxx: don't use CheckAccess with mode on Windows 2013-12-05 15:05:01 +06:00
Denis Krjuchkov
06d7169674 fs/FileSystem.hxx: add CheckAccess without mode parameter 2013-12-05 15:05:01 +06:00
Denis Krjuchkov
8bf1640932 fs/Traits.cxx: don't return drive path without trailing separator 2013-12-05 15:05:01 +06:00
Denis Krjuchkov
da50c888fe fs/Traits.hxx: introduce PathTraitsXXX::IsDrive function 2013-12-05 15:05:01 +06:00
Denis Krjuchkov
62dc8e4131 fs/Charset.cxx: replace \ with / when converting path to UTF-8 on Windows 2013-12-05 15:04:52 +06:00
Denis Krjuchkov
dc554ca61f PlaylistSong.cxx: don't use g_build_filename 2013-12-05 12:35:29 +06:00
Denis Krjuchkov
cbb9149a82 fs/Traits.hxx: add shorter forms of PathTraitsXXX::Build() 2013-12-05 12:35:28 +06:00
Denis Krjuchkov
dab7348da8 fs/Traits.hxx: add PathTraitsUTF8::GetLength for consistency 2013-12-05 12:35:28 +06:00
Denis Krjuchkov
378e8a6224 fs/AllocatedPath.cxx: don't use g_path_get_dirname 2013-12-05 12:35:28 +06:00
Denis Krjuchkov
289fdcc52b fs/Traits: implement GetBase/GetParent/Build using templates 2013-12-05 12:35:21 +06:00
Denis Krjuchkov
83e6e3e31f fs/Traits.cxx: don't return empty string if parent dir is root 2013-12-05 12:27:31 +06:00
Denis Krjuchkov
c387031252 fs/Traits.hxx: add FindLastSeparator function to PathTraitsXXX 2013-12-05 04:09:07 +06:00
Denis Krjuchkov
403bd77eff fs/Traits: improve compatibility between PathTraitsFS and PathTraitsUTF8 2013-12-05 04:01:29 +06:00
Denis Krjuchkov
b397c46184 fs/Traits.hxx: add gcc_nonnull_all where applicable 2013-12-05 03:56:51 +06:00
Denis Krjuchkov
0a6c4c31b2 fs/Traits: split PathTraits type into PathTraitsFS and PathTraitsUTF8 2013-12-05 03:53:43 +06:00
Max Kellermann
02fcf184b5 tag/ApeLoader: use new[]/delete[] instead of g_malloc()/g_free() 2013-12-04 15:21:10 +01:00
Max Kellermann
b978126bb0 DirectorySave: don't duplicate string
Not necessary anymore for playlist_metadata_load().
2013-12-04 15:11:23 +01:00
Max Kellermann
9f51d19087 PlaylistFile: use std::string for temporary string allocation 2013-12-04 15:07:45 +01:00
Max Kellermann
859184000f Mapper: update API documentation 2013-12-04 15:04:54 +01:00
Max Kellermann
1ad2f18c9e IcyMetaDataParser: use new[]/delete[] instead of g_malloc()/g_free() 2013-12-04 15:03:39 +01:00
Max Kellermann
06a49a5f9e TagId3: make variables more local 2013-12-04 14:52:34 +01:00
Max Kellermann
b811927e0e TagId3: use std::string for partial string copy 2013-12-04 14:43:09 +01:00
Max Kellermann
83cdd0a0c8 TagId3: use free() instead of g_free() for libid3tag allocations 2013-12-04 14:39:30 +01:00
Max Kellermann
53c69cd2ce TagId3: use new[]/delete[] instead of g_malloc()/g_free() 2013-12-04 14:36:13 +01:00
Max Kellermann
c6cf8e992d TagId3: gcc_unlikely instead of G_UNLIKELY 2013-12-04 14:35:16 +01:00
Max Kellermann
0c53e8c2d0 system/Resolver: use std::string to allocate internal buffer
No GLib memory allocation.
2013-12-04 14:27:28 +01:00
Max Kellermann
e1901e97c2 system/Resolver: sockaddr_to_string() returns std::string()
No GLib memory allocation.
2013-12-04 08:43:55 +01:00
Max Kellermann
d694150372 Tag: destructor calls Clear()
Eliminate duplicate code.
2013-12-03 13:19:45 +01:00
Max Kellermann
4ab586aaf1 Tag: use new[]/delete[] instead of g_new()/g_free() 2013-12-03 13:16:43 +01:00
Max Kellermann
8a5209ad93 Tag: remove method AddItem()
Use class TagBuilder instead.
2013-12-03 13:15:42 +01:00
Max Kellermann
308fdf6e9a input/curl: use class TagBuilder 2013-12-03 13:14:11 +01:00
Max Kellermann
9f4e96fdfa PaylistTag: use class TagBuilder 2013-12-03 12:59:55 +01:00
Max Kellermann
c36af35730 TagBuilder: add move operator 2013-12-03 12:59:33 +01:00
Max Kellermann
424f478c3f TagBuilder: reserve items in move constructor 2013-12-03 12:59:32 +01:00
Max Kellermann
5e0c272061 TagBuilder: make conversion constructors "explicit" 2013-12-03 12:53:13 +01:00
Max Kellermann
d99bdca094 playlist/xspf: use class TagBuilder 2013-12-03 12:33:14 +01:00
Max Kellermann
187069bec9 playlist/xspf: rename "tag" to "tag_type" 2013-12-03 12:30:55 +01:00
Max Kellermann
01de768f09 playlist/soundcloud: use class TagBuilder 2013-12-03 12:30:00 +01:00
Max Kellermann
73a861abf1 playlist/rss: use class TagBuilder 2013-12-03 12:25:22 +01:00
Max Kellermann
b4f60ee95c playlist/rss: rename "tag" to "tag_type" 2013-12-03 12:25:13 +01:00
Max Kellermann
85e587a882 playlist/pls: use class TagBuilder 2013-12-03 12:23:45 +01:00
Max Kellermann
d91f6dc1b5 playlist/extm3u: use class TagBuilder 2013-12-03 12:21:22 +01:00
Max Kellermann
78c0d8cc88 playlist/asx: use class TagBuilder 2013-12-03 12:15:43 +01:00
Max Kellermann
b23d2ad43b playlist/asx: rename "tag" to "tag_type" 2013-12-03 12:14:55 +01:00
Max Kellermann
ef68946e74 CueParser: use class TagBuilder 2013-12-03 12:09:21 +01:00
Max Kellermann
a5574f9189 TagBuilder: implement the assignment operator 2013-12-03 12:09:21 +01:00
Max Kellermann
ba61a92897 CueParser: rename local variables "current_tag" to "tag" 2013-12-03 11:58:27 +01:00
Max Kellermann
68fc3704e9 CueParser: rename "tag" to "header_tag" 2013-12-03 11:55:32 +01:00
Max Kellermann
69867015e9 DespotifyUtils: use class TagBuilder 2013-12-03 11:46:31 +01:00
Max Kellermann
923f18ef76 IcyMetaDataParser: use class TagBuilder 2013-12-03 11:46:26 +01:00
Max Kellermann
7e8d254b95 Tag: move code from Merge() to TagBuilder::Complement() 2013-12-03 11:46:24 +01:00
Max Kellermann
6325c3f14a TagBuilder: add Tag copy/move constructors 2013-12-03 11:46:23 +01:00
Max Kellermann
074a23e6b4 TagBuilder: add method HasType() 2013-12-03 11:46:21 +01:00
Max Kellermann
2fb61534a1 Merge branch 'master' of git://git.musicpd.org/dk/mpd 2013-12-03 11:46:04 +01:00
Max Kellermann
12b6c6ccf7 OutputAll: use new[]/delete[] instead of g_new()/g_free() 2013-12-03 10:51:50 +01:00
Denis Krjuchkov
55ed7bd34d AllocatedPath.hxx: use move constructor 2013-12-03 14:57:26 +06:00
Denis Krjuchkov
eeeef3eab5 fs/AllocatedPath: use PathTraits::BuildFS 2013-12-03 13:50:50 +06:00
Denis Krjuchkov
96413b1604 fs/Traits.hxx: implement BuildFS() method 2013-12-03 13:46:05 +06:00
Denis Krjuchkov
2278fe42e5 fs/Traits.hxx: move definition of AllocatedPath::string to PathTraits 2013-12-03 13:37:35 +06:00
Denis Krjuchkov
3a183f869f fs/Traits.hxx: add GetLengthFS()
There is no GetLengthUTF8() because strlen or std::string::size()
could be used instead.
2013-12-03 12:26:05 +06:00
Denis Krjuchkov
6c5828822c fs/AllocatedPath.hxx: add FromFS(std::string) method 2013-12-03 12:16:53 +06:00
Denis Krjuchkov
9dd824ba50 fs/Traits.hxx: don't use g_path_is_absolute 2013-12-03 11:59:57 +06:00
Denis Krjuchkov
d744ea3fca fs/Traits.hxx: simplify code
- Move definition of SEPARATOR_UTF8 out of #ifdef
- Remove duplicated check in IsSeparatorUTF8
2013-12-03 11:48:45 +06:00
Denis Krjuchkov
07352e82f1 PollGroupWinSelect: delete copy constructor and assignment operator 2013-12-03 11:43:26 +06:00
Denis Krjuchkov
1003cc9bf9 PollGroupWinSelect: uninline constructor and destructor 2013-12-03 11:41:36 +06:00
Lukas Stabe
0ea5f4ac3a output/openal: check __APPLE__ instead of HAVE_OSX
On OSX, the configure-flag --enable-osx is used to enable the
unsupported osx output. It sets the HAVE_OSX preprocessor define.

src/output/OpenALOutputPlugin.cxx uses this define to determine wether
it is building on OSX, and imports different headers (which have
nothing to do with the osx output) depending on wether or not it is
set.
2013-12-02 13:08:52 +01:00
Max Kellermann
2b717997e2 command: add commands "addtagid", "cleartagid" 2013-12-02 12:50:27 +01:00
Max Kellermann
20ebacf489 Tag: add methods RemoveAll(), RemoveType() 2013-12-02 12:46:48 +01:00
Max Kellermann
c6ef0e8887 pcm/Traits: add typedef "sum_type"
Allow 32 bit platforms to use 32 bit instead of 64 bit for summing 24
bit samples.
2013-12-02 11:48:10 +01:00
Max Kellermann
f761d583b5 pcm/Traits: use int_leastX_t types 2013-12-02 11:47:17 +01:00
Max Kellermann
cee1ac150e pcm/PcmChannels: implement fake N-to-M mapping
This is really just a mono mapper, but the important part is that this
library cannot fail anymore.
2013-12-02 11:42:19 +01:00
Max Kellermann
71b47ae3ef pcm/PcmChannels: use the SampleTraits library 2013-12-02 11:28:54 +01:00
Max Kellermann
36e3fda554 pcm/Traits: add template specialization for FLOAT 2013-12-02 11:26:38 +01:00
Max Kellermann
2b44a2c9bd pcm/PcmChannels: use struct ConstBuffer 2013-12-02 11:21:32 +01:00
Max Kellermann
af3b454805 pcm/PcmBuffer: add typed method GetT() 2013-12-02 11:21:32 +01:00
Max Kellermann
3a0f3eaa50 pcm/PcmUtils: use the SampleTraits library 2013-12-02 11:21:32 +01:00
Max Kellermann
80eb8d9e26 pcm/PcmUtils: remove unused function PcmClampN() 2013-12-02 11:21:32 +01:00
Max Kellermann
30c4136c4d pcm/PcmVolume: use the SampleTraits library 2013-12-02 11:21:32 +01:00
Max Kellermann
83e4475021 pcm/PcmFormat: use SampleTraits::long_type in ConvertFromFloat() 2013-12-02 11:21:32 +01:00
Max Kellermann
c071d6d9f6 pcm/PcmPrng: add "constexpr" 2013-12-02 11:21:32 +01:00
Denis Krjuchkov
1df426aa5c event: add poll() based PollGroup implementation 2013-12-02 14:39:52 +06:00
Max Kellermann
023482406f pcm/PcmMix: use the SampleTraits library for MixRamp 2013-12-01 22:49:50 +01:00
Max Kellermann
04ba40981f pcm/PcmMix: use the SampleTraits library 2013-12-01 22:44:16 +01:00
Max Kellermann
fc10bdf24d pcm/SampleTraits: use 64 bit for S24 long_type 2013-12-01 22:44:16 +01:00
Max Kellermann
28ad79c97a pcm/Traits: add typedef long_type 2013-12-01 19:32:48 +01:00
Max Kellermann
7661ad6653 pcm/Traits: add API documentation 2013-12-01 19:32:00 +01:00
Max Kellermann
e1436063ff pcm/PcmFormat: move generic definitions to Traits.hxx 2013-12-01 19:24:37 +01:00
Max Kellermann
3e11a28cd9 pcm/SoxrResampler: new resampler option using libsoxr 2013-12-01 19:13:39 +01:00
Max Kellermann
3ed80f3139 pcm/ConfiguredResampler: convert boolean flag to enum
Prepare for adding more resamplers.
2013-12-01 19:13:39 +01:00
Max Kellermann
5ba90cd8ea pcm/PcmResampler: convert to abstract interface
The PcmResampler interface is implemented by the two classes
FallbackPcmResampler and LibsampleratePcmResampler.  This prepares for
adding more resampler libraries.
2013-11-30 16:22:57 +01:00
Max Kellermann
e9127523db pcm/PcmConvert: move code to new class GluePcmResampler 2013-11-30 14:10:31 +01:00
Max Kellermann
92004f2e7e pcm/PcmConvert: move code to new class PcmChannelsConverter 2013-11-30 13:22:25 +01:00
Max Kellermann
0eefc7a43c pcm/PcmConvert: move code to new class PcmFormatConverter 2013-11-30 13:08:55 +01:00