Max Kellermann
a8770aa606
input/curl: fix curl_easy_setopt() parameter types
2014-11-01 14:09:30 +01:00
Max Kellermann
217d88f21f
TextInputStream: don't ignore unterminated last line
2014-10-28 22:10:47 +01: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
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
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
Max Kellermann
9d2d58c4b6
input/LocalOpen: new library for opening local files
...
Combines the "file" and the "archive" input plugins.
2014-10-02 21:06:01 +02:00
Max Kellermann
0c461c3859
input/archive: export function OpenArchiveInputStream()
2014-10-02 21:00:38 +02:00
Max Kellermann
0d38bd9b3b
input/file: export function OpenFileInputStream()
2014-10-02 20:44:03 +02:00
Max Kellermann
2f02e49b9f
input/file: generate Error when errno==ENOENT
...
This special case was useless. Fixes the dreaded "Unrecognized URI"
error message when a file does not exist.
2014-10-02 20:16:05 +02:00
Max Kellermann
064e8a7c68
input/file: make the "fd" attribute "const"
2014-10-02 19:55:01 +02:00
Max Kellermann
e4dd269609
input/file: make variables more local
2014-10-02 19:18:58 +02:00
Max Kellermann
37501d9bc7
input/file: convert to class
2014-10-02 19:14:59 +02:00
Thomas Guillem
9836b1dddd
CurlInputPlugin: fix crash after second init call
...
The second time init was called, http_200_aliases pointed to a freed pointer
and leaded to a SEGFAULT.
2014-09-16 18:25:25 +02:00
Max Kellermann
60589fc1cb
input/nfs: auto-reconnect if failed while paused
2014-09-02 21:27:07 +02:00
Max Kellermann
5121316036
input/async: add method IsPaused()
2014-09-02 20:02:56 +02:00
Max Kellermann
ba8e3f11e2
input/nfs: notify client on error
...
Fixes hanging NFS client.
2014-08-31 18:26:32 +02:00
Max Kellermann
b373c53ce4
*: add missing Compiler.h includes
...
Necessary for "final" on gcc 4.6.
2014-08-30 00:46:52 +02:00
Max Kellermann
bb472206de
InputStream: move typedef offset_type to Offset.hxx
...
Reduce header dependencies.
2014-08-19 22:29:52 +02:00
Max Kellermann
d87cf5146e
InputStream: CheapSeeking() returns false only for HTTP
...
Seeking on NFS or SMB is cheap. Actually, only HTTP streams are
expensive to seek. This enables a few features on NFS/SMB files, for
example Ogg tags.
2014-08-19 21:39:12 +02:00
Max Kellermann
87eb5cbced
InputStream: move code to ExpensiveSeeking()
2014-08-19 21:38:18 +02:00
Max Kellermann
181edf4b53
InputStream: make offset_type unsigned
2014-08-19 21:23:03 +02:00
Max Kellermann
dfa53cb88e
InputPlugin: remove typedef offset_type
...
Has been moved to class InputStream long ago.
2014-08-19 21:22:23 +02:00
Max Kellermann
d079cda174
InputStream: allow GetSize() only if KnownSize()
2014-08-19 21:02:00 +02:00
Max Kellermann
4265e71d6f
InputStream: add constant UNKNOWN_SIZE
2014-08-19 21:00:50 +02:00
Max Kellermann
f66a72c66b
input/proxy: use KnownSize()
2014-08-19 21:00:32 +02:00
Max Kellermann
672f678ed6
InputStream: use KnownSize() in assertion
2014-08-19 11:59:19 +02:00
Max Kellermann
e6e9c21275
input/ffmpeg: use av_strerror()
...
Generate more detailed error messages.
2014-08-18 20:35:34 +02:00
Max Kellermann
636f5d4a1d
{input,decoder}/ffmpeg: move ffmpeg_domain to lib/ffmpeg/Domain.cxx
...
Eliminate duplicate definition (in input plugin and decoder plugin).
2014-08-18 10:12:37 +02:00
Max Kellermann
41a4b280ee
input/ffmpeg: update offset after seeking
2014-08-18 09:52:53 +02:00
Max Kellermann
27139bf41f
input/ffmpeg: refactor error code path
2014-08-18 09:52:25 +02:00
Max Kellermann
12ba1957d0
input/ffmpeg: use "auto"
2014-08-18 09:47:28 +02:00
Max Kellermann
5ac2a69940
input/TextInputStream: move ReadBufferedLine() to util/TextFile.hxx
2014-08-07 19:38:25 +02:00
Max Kellermann
1ca8d7ad45
TextInputStream: don't strip
...
Let the caller decide whether to strip. Only remove \n and \r
(end-of-line markers).
2014-08-07 16:45:43 +02:00
Max Kellermann
36ff991960
TextInputStream: move code to ReadBufferedLine()
...
Look at the buffer first, before trying to read from the file. This
reduces overhead because we don't refill the buffer after every line.
2014-08-07 16:08:02 +02:00
Max Kellermann
59d38f876a
util/StringUtil: add StripRight() overload with "end" argument
2014-08-07 16:08:02 +02:00
Max Kellermann
db6db51742
util/CharUtil: add IsWhitespaceFast()
2014-08-07 16:08:02 +02:00
Max Kellermann
69ae879c58
input/TextInputStream: return char*
...
Revert to the old API before commit e9e55b08
, removing unnecessary
bloat.
2014-08-07 00:06:02 +02:00
Max Kellermann
ea26da0be7
util/FifoBuffer: rename to StaticFifoBuffer
2014-08-06 17:29:05 +02:00
Max Kellermann
681643ea9e
input/curl: options "verify_peer" and "verify_host"
2014-07-11 16:39:42 +02:00
Max Kellermann
b123392592
input/async: more API documentation
2014-07-10 10:33:43 +02:00
Max Kellermann
d5fa2af353
input/async: use IsEOF() instead of !open for "ready" check
...
Checking "!open" did not work with the NFS plugin because that plugin
does not close the file automatically, unlike CURL.
2014-06-21 14:13:31 +02:00
Max Kellermann
a877926f08
Revert "AsyncInputStream: fix assertion failure in AppendToBuffer()"
...
This reverts commit 966c4244cb
.
The commit was bad, because the bug was really in
NfsInputStream::DoRead(); see previous commit.
2014-06-21 14:07:15 +02:00
Max Kellermann
3e4e6f7ced
input/nfs: never read more than space available in buffer
...
Avoids off-by-one bug and obsoletes the bug fix in commit 966c4244
2014-06-21 14:06:31 +02:00
Max Kellermann
c99559dbe9
input/nfs: use the asynchronous libnfs API
...
More robust and cancellable.
2014-06-17 03:21:25 +02:00
Max Kellermann
966c4244cb
AsyncInputStream: fix assertion failure in AppendToBuffer()
2014-06-17 03:21:11 +02:00
Max Kellermann
81283f8bcb
AsyncInputStream: reset "paused" when seeking
...
May cause assertion failure.
2014-06-17 03:20:49 +02:00
Max Kellermann
8b84e5b3f9
input/curl: hold mutex while writing to postponed_error
2014-06-17 02:32:17 +02:00
Max Kellermann
e1d5ddb478
input/AsyncInputStream: add method IsBufferFull()
2014-06-17 02:32:17 +02:00
Max Kellermann
fb52a24da3
input/async: add offset/size comparison to IsEOF()
2014-05-24 15:19:22 +02:00
Max Kellermann
fbafb19657
input/curl: move code to AsyncInputStream
...
New base class for other InputStream implementations that run in the
I/O thread.
2014-05-24 14:36:28 +02:00
Max Kellermann
6c4438d8a9
input/curl: call SetReady() only if not yet ready
...
Fixes assertion failure.
2014-05-24 14:36:25 +02:00
Max Kellermann
be00737ced
input/curl: include cleanup
2014-05-24 12:43:48 +02:00
Max Kellermann
07b93dcf80
InputStream: make Seek() always absolute
...
Remove the "whence" parameter that is not actually necessary, and only
complicates the InputStream implementations.
2014-05-22 13:52:00 +02:00
Max Kellermann
49695d47d3
input/curl: relock mutex in error paths
2014-05-21 19:00:47 +02:00
Max Kellermann
5cec477131
input/curl: pass remaining size to CircularBuffer::Append()
2014-05-21 18:59:51 +02:00
Max Kellermann
a5d0300787
input/curl: move code to IcyInputStream
2014-05-21 18:47:49 +02:00
Max Kellermann
09b84c51ee
input/rewind: move code to class ProxyInputStream
2014-05-21 18:47:49 +02:00
Max Kellermann
c42e412c0a
input/InputStream: move Open() to Open.cxx
...
Allow compiling test programs with only selected plugins.
2014-05-21 18:47:32 +02:00
Max Kellermann
542e7feba8
input/rewind: include cleanup
2014-05-21 18:47:22 +02:00
Max Kellermann
dc085e0bd2
input/rewind: work around assertion failure
...
Caused by commit 0b4fa41a
2014-05-21 18:47:12 +02:00
Max Kellermann
7c9517343c
ThreadInputStream: include cleanup
2014-05-12 19:04:32 +02:00
Max Kellermann
0b4fa41aff
InputStream: "protect" attributes
2014-05-12 18:59:46 +02:00
Max Kellermann
e138e2c880
input/cdio: convert to class
2014-05-12 18:59:25 +02:00
Max Kellermann
0d6345e98b
input/cdio: move initialization code to constructor
...
Make attributes const, don't allow partial initialization.
Instantiate the CdioParanoiaInputStream object at the end of
input_cdio_open().
2014-05-12 18:54:05 +02:00
Max Kellermann
a84bcf597d
input/cdio: handle cdio_open() failure
2014-05-12 18:53:47 +02:00
Max Kellermann
4bbd4ba855
input/cdio: initialize lsn_relofs in constructor
2014-05-12 18:48:16 +02:00
Max Kellermann
9e5b56b475
input/cdio: initialize attribute "buffer_lsn"
2014-05-12 18:47:27 +02:00
Max Kellermann
dd383037fd
input/cdio: remove unused attribute "trackno"
2014-05-12 18:41:45 +02:00
Max Kellermann
fd1b04932a
InputStream: remove attribute "plugin"
2014-05-11 18:25:55 +02:00
Max Kellermann
d4b625b48e
InputStream: make various methods abstract
...
Replace InputPlugin attributes.
2014-05-11 17:14:49 +02:00
Max Kellermann
82337dec44
InputStream: add virtual destructor
...
Replaces the method Close().
2014-05-11 17:12:50 +02:00
Max Kellermann
f1d0700252
input/plugins: make InputStream the base class
...
Prepare for adding virtual methods.
2014-05-11 17:12:50 +02:00
Max Kellermann
e1383a2d8e
input/rewind: convert to class
2014-05-11 17:12:50 +02:00
Max Kellermann
6773adc771
InputStream: convert to class
2014-05-11 15:34:48 +02:00
Max Kellermann
7ecf4ad54d
input/nfs: add missing string.h include
...
For strrchr(). Fixes build failure.
2014-04-23 12:53:19 +02:00
Max Kellermann
707d379b97
input/mms: move blocking I/O to thread
2014-03-16 11:48:46 +01:00
Max Kellermann
88a0a48b03
input/BufferedInputStream: new wrapper for moving plugin to thread
2014-03-16 10:26:40 +01:00
Max Kellermann
e9912bcf8a
input/alsa: don't initialize "seekable=false", "size=-1"
...
These are the default values already.
2014-03-16 09:52:17 +01:00
Max Kellermann
c7e2f558a0
input/curl: use CircularBuffer
...
Replaces its own weird buffering code.
2014-03-16 00:35:28 +01:00
Max Kellermann
8f74bf314d
input/curl: add method CurlInputStream::Open()
2014-03-15 22:56:05 +01:00
Max Kellermann
0dd5ebbdbe
input/curl: move _seek() into the CurlInputStream class
2014-03-15 22:42:37 +01:00
Max Kellermann
2ae60767a3
input/curl: move _easy_init() into the CurlInputStream class
2014-03-15 22:38:46 +01:00
Max Kellermann
64f31f70f9
input/curl: pass std::string&& to HeaderReceived()
...
Code simplification.
2014-03-15 22:02:59 +01:00
Max Kellermann
23eacbd132
input/curl: move code to CurlInputStream methods
2014-03-15 20:43:37 +01:00
Max Kellermann
e9f16fca96
input/curl: rename "error" to "error_buffer"
2014-03-15 20:43:17 +01:00
Max Kellermann
3d30de91f3
input/curl: rename struct input_curl to CurlInputStream
2014-03-15 20:38:08 +01:00
Max Kellermann
2bf2f34b12
InputPlugin: allow init() to soft-fail
...
Add enum InputResult which is a tri-state. Input plugins may now fail
and just become unavailable.
2014-03-02 00:17:32 +01:00
Max Kellermann
4ba7427fa0
util/{Const,Writable}Buffer: add operator[]
2014-03-01 07:49:13 +01:00
Max Kellermann
7757e59e78
input/curl: include cleanup
2014-02-22 00:18:29 +01:00
Max Kellermann
d761d8b168
input/nfs: move nfs_domain to lib/nfs/Domain.cxx
2014-02-08 14:24:47 +01:00
Max Kellermann
fe7c6fee34
ArchivePlugin: pass Path to open()
2014-02-08 13:25:44 +01:00
Max Kellermann
9906daeca7
ArchivePlugin: rename struct archive_plugin to ArchivePlugin
2014-02-08 13:22:13 +01:00
Max Kellermann
c8f0c7e9ed
*/smbclient: protect all libsmbclient calls with a mutex
...
libsmbclient is not thread-safe nor reentrant. We must protect all
function calls with a global mutex, unfortunately.
2014-02-06 22:19:59 +01:00
Max Kellermann
e4322a716c
input/nfs: new plugin using libnfs
2014-02-06 18:37:27 +01:00
Max Kellermann
86ca5b3f16
input/smbclient: move code to lib/smbclient/Init.cxx
2014-01-25 23:29:42 +01:00
Max Kellermann
9b1fbdbca6
ConfigGlobal: add config_find_block()
...
Merge duplicate code.
2014-01-24 16:55:17 +01:00
Max Kellermann
97391fd4b9
DespotifyUtils, Expat: move to lib/
2014-01-24 16:44:36 +01:00
Max Kellermann
f8bfea8bae
Input*: move to input/
2014-01-24 16:33:33 +01:00
Max Kellermann
197b503f3e
Config*: move to config/
2014-01-24 00:20:01 +01:00