Commit Graph

833 Commits

Author SHA1 Message Date
Eugene Gorodinsky 4e2a551f30 Add runtime enumeration of supported schemas.
Fix src/ls.cxx to only print unique schemas.
Refactor src/ls.cxx to use src/input/InputPlugin functionality.

Add dynamic enumeration support to curl plugin.
2019-07-01 09:49:34 +03:00
Max Kellermann 01fd6e5e82 Merge branch 'v0.21.x' 2019-06-27 14:51:05 +02:00
Max Kellermann 8bf3f9b874 input/tidal: deprecated because Tidal has changed the protocol
See https://github.com/MusicPlayerDaemon/MPD/issues/545
2019-06-26 23:14:07 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann bd6b7aa88e archive/Lookup: move to fs/LookupFile.cxx
This can be used for other purposes as well.
2019-06-15 14:26:26 +02:00
Max Kellermann fcf6415963 archive/Lookup: pass class Path 2019-06-15 14:06:50 +02:00
Max Kellermann be79b44dc8 archive/Lookup: pass const pointer 2019-06-15 14:04:34 +02:00
Max Kellermann 0019231a37 archive/Lookup, input/Archive: remove useless log messages 2019-06-04 17:54:35 +02:00
Max Kellermann 9ae1256ae7 input/archive: include cleanup 2019-05-31 19:59:09 +02:00
Max Kellermann e1ac377812 archive/ArchiveLookup: replace output parameters with a struct 2019-05-31 19:56:25 +02:00
Max Kellermann 0e8ca44968 archive/List: disallow passing suffix==nullptr to archive_plugin_from_suffix() 2019-05-31 19:05:26 +02:00
Max Kellermann 12e75a523a archive/ArchiveLookup: remove "suffix" output parameter
Let the caller do this.  Our GetSuffix() function was broken anyway.
2019-05-31 19:01:22 +02:00
Max Kellermann fa13648f2c archive/ArchiveLookup: throw on error 2019-05-31 18:52:11 +02:00
Max Kellermann 5d74b5cee1 input/cache: first draft of the file cache 2019-05-31 17:49:52 +02:00
Max Kellermann 9ed4fac341 input/InputStream: check offset in Rewind()
Don't call Seek() if the stream is already at the beginning.  This
avoids unnecessary exceptions if seeking is not implemented by an
Inputstream implementation.
2019-05-31 17:47:16 +02:00
Max Kellermann 155c915733 input/buffering: make "mutex" public 2019-05-29 13:44:05 +02:00
Max Kellermann 971450f0d4 input/InputStream: make IsEOF() and IsAvailable() const 2019-05-29 13:31:54 +02:00
Max Kellermann 40a48cfba0 PluginUnavailable: add subclass PluginUnconfigured
PluginUnconfigured exceptions are logged with level "info" instead of
"error".  This suppresses some rather boring messages in the default
log level.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/565
2019-05-23 14:25:14 +02:00
Max Kellermann 43fe513de8 input/buffering: add API documentation 2019-05-22 12:09:20 +02:00
Max Kellermann c1b853ca7c input/InputStream: define UNKNOWN_SIZE without undefined behavior 2019-05-22 12:01:46 +02:00
Max Kellermann 4b78038b41 input/InputStream: update API documentation 2019-05-22 12:00:16 +02:00
Max Kellermann 6922a2f55e input/buffered: check error in IsAvailable() 2019-05-17 12:43:45 +02:00
Max Kellermann 219546cb81 input/buffering: check error in IsAvailable() 2019-05-17 12:43:06 +02:00
Max Kellermann 555a4d738c input/buffering: pass offset to Read() and eliminate Seek()
Another step towards supporting multiple readers.
2019-05-17 12:02:55 +02:00
Max Kellermann 813567bf5c input/buffering: use notify_one() to wake up thread
There is just one thread.
2019-05-17 11:57:23 +02:00
Max Kellermann 16a07bc201 input/buffering: remove obsolete thread wakeup
The thread will always attempt to read more data since commit
2cf6b77627, so we don't need to tell it
to continue.
2019-05-17 11:56:30 +02:00
Max Kellermann 1153715608 input/buffering: rename "read_error" to "error"
The "seek_error" attribute will be eliminated soon.
2019-05-17 11:29:19 +02:00
Max Kellermann b5c7c16fb4 input/buffering: merge multiple exception handlers into RunThread() 2019-05-17 11:23:54 +02:00
Max Kellermann 302c0515b7 input/buffering: move code to RunThreadLocked() 2019-05-17 11:21:56 +02:00
Max Kellermann 19e4672a54 input/buffering: use notify_all() instead of notify_one()
More preparations to support multiple readers.
2019-05-17 11:17:16 +02:00
Max Kellermann c2dd6808e1 input/buffering: make read errors fatal, no recovery
If a read error occurs, it is very unlikely that the InputStream will
ever recover.  Removing the code removes some code complexity which
just isn't worth it.  And it allows supporting multiple readers for
one buffer.
2019-05-17 10:55:58 +02:00
Max Kellermann 2cf6b77627 input/buffering: eliminate "idle" flag, automatically seek to next hole 2019-05-16 22:42:29 +02:00
Max Kellermann a5c09f4ddb input/buffering: destruct our input while mutex is unlocked 2019-05-16 22:38:37 +02:00
Max Kellermann 1acb9bcedb input/buffering: close input if buffered completely 2019-05-16 22:34:11 +02:00
Max Kellermann 0626e3d21e input/buffering: at end of input, seek to first hole 2019-05-16 22:29:10 +02:00
Max Kellermann 869d215058 input/buffering: merge "read_error" and "idle" checks in thread 2019-05-16 22:25:21 +02:00
Max Kellermann 0cf922b2da input/buffering: clear read_error after successful seek
After seeking, a new read should be done.
2019-05-16 22:24:57 +02:00
Max Kellermann 5e266cd8e4 Merge branch 'v0.21.x' 2019-05-16 22:12:48 +02:00
Max Kellermann ca5a400dbe input/buffered: rethrow read_error in Check() 2019-05-16 22:08:33 +02:00
Max Kellermann 63fe4d1d17 input/buffered: wake up client thread on seek error 2019-05-16 22:05:25 +02:00
Max Kellermann a199f58db5 input/buffering: update thread name 2019-05-16 22:02:51 +02:00
Max Kellermann 5277297336 input/buffered: move basic buffering code to class BufferingInputStream
Prepare to reuse it in another class.
2019-05-16 21:41:28 +02:00
Max Kellermann 604d08b2c6 Merge branch 'v0.21.x' 2019-05-16 21:26:45 +02:00
Max Kellermann ca06d9d3bf input/buffered: fix deadlock bug 2019-05-16 21:11:03 +02:00
Max Kellermann 973c87b351 event/Call, ...: use wait() with predicate 2019-05-07 20:01:45 +02:00
Max Kellermann 0a0cc66e8f thread/Mutex: use using instead of making it a derived class
Prepare the transition to std::mutex.
2019-05-07 19:23:01 +02:00
Max Kellermann 1b5c1f75a4 input/InputStreams: pass std::unique_lock<> to various methods 2019-05-07 19:09:39 +02:00
Max Kellermann 92022658f9 thread/Cond: add wait() overload which takes a unique_lock<>
Just like std::condition_variable, which however has no way to specify
the std::mutex directly.
2019-04-26 11:51:45 +02:00
Max Kellermann b51bae5500 thread/*Cond: rename methods to match std::condition_variable 2019-04-25 19:46:43 +02:00
Max Kellermann 9da7509944 input/curl: use class ScopeUnlock 2019-04-25 19:33:50 +02:00