Max Kellermann
24780d99e6
input_plugin: rename struct to "InputPlugin"
2013-10-17 10:20:57 +02:00
Max Kellermann
1b8a1d4140
ArchiveLookup: return const strings
2013-10-17 00:36:52 +02:00
Max Kellermann
5e26e2ab1d
system/ByteOrder: new library for byte ordering / endianess
...
Replacing GLib macros.
2013-10-16 22:09:44 +02:00
Max Kellermann
fa13a6616f
Archive*: move archive_domain to ArchiveDomain.cxx
...
Merge duplicate symbol.
2013-10-15 23:24:54 +02:00
Max Kellermann
25c208d81d
input/*: don't allocate attribute "mime"
...
This was a memory leak, because "mime" was a std::string which created
another copy and discarded the allocated buffer.
2013-10-15 22:49:23 +02:00
Max Kellermann
9508ea982b
fs/Path: add method IsAbsolute()
2013-10-14 22:38:29 +02:00
Max Kellermann
6fd481df97
Mapper, ...: use memcmp() instead of strncmp() where appropriate
...
Micro-optimization.
2013-10-14 22:00:21 +02:00
Max Kellermann
060814daa8
Log: new logging library API
...
Prepare to migrate away from GLib. Currently, we're still using GLib
as a backend.
2013-10-02 08:57:55 +02:00
Artem Savkov
585b68d2ae
input/curl: fix EventLoop stall after curl_easy_pause
...
When playing finite http streams, e.g. something from soundcloud,
eventloop stalls after pausing writefunc. TimeoutMonitor is cancelled
by the time resume happens, so when enough data is consumed writefunc
is called only once. Calling InvalidateSockets() from
input_curl_resume() seems to fix the issue.
2013-09-26 17:27:35 +02:00
Max Kellermann
3f267b1795
Tag, ...: move to libtag.a
2013-09-05 18:26:56 +02:00
Ales Guzik
3330aa6f6a
input/curl: enable https
2013-09-05 11:56:49 +02:00
Max Kellermann
26d92c80ed
conf.h: remove obsolete header
...
Use only ConfigData.hxx in plugin sources to reduce header
dependencies.
2013-09-05 08:47:10 +02:00
Max Kellermann
7d0269d2ce
InputLegacy: move functions to the input_stream class
2013-09-05 00:23:14 +02:00
Max Kellermann
29030b54c9
util/Error: new error passing library
...
Replaces GLib's GError.
2013-09-04 18:14:22 +02:00
Max Kellermann
bbd7115564
input/{mms,despotify}: remove "seek" implementation
...
Omitting it has the same effect as returning false unconditionally.
2013-09-03 10:54:29 +02:00
Max Kellermann
84ac79bb08
event/MultiSocketMonitor: eliminate virtual method CheckSockets()
...
Handle timeout internally.
2013-08-10 11:52:31 +02:00
Max Kellermann
be0c8495cd
event/MultiSocketMonitor: PrepareSockets() returns timeout
...
Simplify the API, don't use GLib specific integer type.
2013-08-10 11:52:31 +02:00
Max Kellermann
018f4155eb
event: add function BlockingCall()
...
Replaces io_thread_call(). This approach is more generic and easier
to use due to std::function.
2013-08-08 23:04:07 +02:00
Max Kellermann
b70d38dc10
Makefile.am: move sources to libsystem.a
2013-08-07 10:31:31 +02:00
Max Kellermann
85b77b81ca
*: use gcc.h macros instead of GLib
2013-08-04 23:48:01 +02:00
Max Kellermann
bf6ed643e0
InputPlugin: pass config_param reference
2013-08-04 14:07:50 +02:00
Max Kellermann
06f898cc12
tag: convert to C++
2013-07-30 20:19:53 +02:00
Max Kellermann
2df2a989af
input/soup: plugin removed
...
This plugin is cumbersome to support, now that MPD is migrating away
from GLib and the GLib event loop. It has no practical advantages
over the CURL plugin. Soup requires the bloated GType library.
2013-04-17 21:46:16 +02:00
Max Kellermann
16afdfd874
ArchivePlugin: move instance methods to class ArchiveFile
2013-01-30 15:30:19 +01:00
Max Kellermann
f260cd031c
input/Rewind: remove bogus assertion
2013-01-30 15:05:54 +01:00
Max Kellermann
f5c0b0d316
ArchiveFile: convert to a class
2013-01-29 23:26:51 +01:00
Max Kellermann
ba51045d9e
refcount: convert to C++
2013-01-29 23:20:19 +01:00
Max Kellermann
20f85745e7
require GLib 2.24
2013-01-29 18:33:37 +01:00
Max Kellermann
76417d4446
InputStream: use std::string
2013-01-28 23:41:45 +01:00
Max Kellermann
cffc78ad6a
InputStream: store references instead of pointers
2013-01-28 23:35:01 +01:00
Max Kellermann
dcf55c7e32
InputStream: add constructor/destructor
...
Eliminate input_stream_init() and input_stream_deinit().
2013-01-28 23:29:43 +01:00
Max Kellermann
e565cd4404
input/despotify: add constructor/destructor
2013-01-28 23:13:19 +01:00
Max Kellermann
5934ccbb74
input/despotify: rename class
2013-01-28 23:12:10 +01:00
Max Kellermann
d0a812d2df
input/Soup: move code into the class
2013-01-28 22:00:24 +01:00
Max Kellermann
3dad2e1c0f
input/soup: rename the class
2013-01-28 21:59:40 +01:00
Max Kellermann
70e4399334
input/ffmpeg: add constructor/destructor
2013-01-28 21:46:38 +01:00
Max Kellermann
00f8c2d46f
input/ffmpeg: rename the class
2013-01-28 21:45:44 +01:00
Max Kellermann
0dd4b52b63
decoder/ffmpeg: require ffmpeg/libav 0.7.6
...
This is the version present in Ubuntu Oneiric, the oldest distribution
with gcc 4.6. Debian Squeeze is off target, because it has gcc 4.4,
which is unable to compile MPD anyway.
This commit drops all API compatibility hacks for older versions.
2013-01-28 21:32:14 +01:00
Max Kellermann
6f3d70b5e2
DecoderControl, InputStream: use Mutex/Cond instead of GMutex/GCond
2013-01-27 18:39:32 +01:00
Max Kellermann
0273cd44b0
input_stream: forward-declare the struct
...
Hide the definition from C code, to prepare the transition to C++.
2013-01-26 01:24:01 +01:00
Max Kellermann
49567f1f3e
input_{internal,plugin}: convert to C++
2013-01-25 22:43:01 +01:00
Max Kellermann
94fffb332b
archive/*: convert to C++
2013-01-24 19:18:58 +01:00
Max Kellermann
7c0e4dfb56
input/archive: fix memory leak in error handler
2013-01-21 19:08:35 +01:00
Max Kellermann
9ec069104f
input,playlist/despotify: convert to C++
2013-01-21 19:01:10 +01:00
Max Kellermann
9cc90b1fbe
input/cdio_paranoia: convert to C++
2013-01-21 17:58:30 +01:00
Max Kellermann
0c9f22507f
input/ffmpeg: convert to C++
2013-01-21 17:50:43 +01:00
Max Kellermann
9c870e4276
input/rewind: convert to C++
2013-01-21 17:36:19 +01:00
Max Kellermann
5cffe693b0
input/file,mms: convert to C++
2013-01-21 10:52:40 +01:00
Max Kellermann
e01615fd1e
input_internal.h: add extern "C"
2013-01-21 10:52:19 +01:00
Max Kellermann
452a30d7af
input/Curl: break loop when remaining length becomes 0
...
Fixes assertion failure (regression).
2013-01-15 23:39:32 +01:00
Max Kellermann
083065f433
input/Curl: move code to class MultiSocketMonitor
2013-01-15 18:16:55 +01:00
Max Kellermann
4cfc4a5a94
input/Curl: simpler GPollFD initialisation
...
Using initializer list.
2013-01-15 18:16:38 +01:00
Max Kellermann
1c7ee737e6
input/Curl: don't remove/add modified GPollFD
...
Not necessary, GLib will pick up the updated GPollFD automatically.
2013-01-15 18:16:15 +01:00
Max Kellermann
e83f805b8f
Main, IOThread: move GMainLoop setup code to class EventLoop
2013-01-14 09:15:49 +01:00
Max Kellermann
631a268996
input/curl: use std::list instead of GQueue
2013-01-10 23:00:23 +01:00
Max Kellermann
85074f5ac6
icy_metadata: convert to C++
2013-01-10 22:33:16 +01:00
Max Kellermann
12a8ed39d4
input/Curl: add constructor to input_curl class
2013-01-10 22:25:57 +01:00
Max Kellermann
b9ac5e9e76
input/Curl: remove unused source/source_id attributes
2013-01-10 22:25:33 +01:00
Max Kellermann
2758a734a2
input/Curl: remove redundant attribute "url"
...
Use the "url" attribute from the base class instead.
2013-01-10 22:21:30 +01:00
Max Kellermann
01f3131c81
input/Curl: use std::forward_list instead of GSList
2013-01-10 20:52:58 +01:00
Max Kellermann
2ca9236864
input/Curl: remove unused attribute "fds"
2013-01-10 20:52:44 +01:00
Max Kellermann
3bb711837e
input/Curl: require libcurl 7.18
2013-01-10 20:46:47 +01:00
Max Kellermann
e0a97a030f
io_thread: convert to C++
2013-01-10 10:33:20 +01:00
Max Kellermann
33ba288622
input/{curl,soup}: convert to C++
2013-01-10 10:23:20 +01:00
Max Kellermann
ef0392e854
input/file: use errno_quark()
2012-10-04 10:32:04 +02:00
Max Kellermann
12838c6294
input/ffmpeg: remove fallback AV_VERSION_INT definition
...
This is part of libavutil.
2012-08-14 19:07:27 +02:00
Max Kellermann
712e3eb120
input/curl: use g_source_get_time()
...
g_source_get_current_time() is deprecated since GLib 2.28. This patch
adds a compatibility wrapper for older GLib versions to glib_compat.h.
2012-04-04 20:05:48 +02:00
Jonathan Neuschäfer
6ab4fb368c
input/cdio_paranoia: whitespace-fix a comment
2012-02-15 21:22:49 +01:00
Max Kellermann
e87b7daab5
input/soup: use #pragma only with gcc 4.6+
...
It seems gcc 4.5 does not allow #pragma within function:
src/input/soup_input_plugin.c:284:9: error: #pragma GCC diagnostic not allowed inside functions
2012-01-29 14:46:05 +01:00
Max Kellermann
9937ff8ac0
Merge branch 'v0.16.x'
...
Conflicts:
src/decoder/ffmpeg_decoder_plugin.c
src/input/ffmpeg_input_plugin.c
2012-01-05 00:33:23 +01:00
Max Kellermann
56257f072b
input/ffmpeg: use the new AVIOContext API
...
URLContext is deprecated.
2012-01-04 21:47:19 +01:00
Max Kellermann
44401158e8
input/ffmpeg: define AV_VERSION_INT if not present
...
Support ancient ffmpeg versions.
2012-01-04 21:47:01 +01:00
Max Kellermann
744d729dab
input/soup: disable -Wcast-qual to work around libsoup header problem
2011-12-12 10:15:04 +01:00
Max Kellermann
52b77f6e31
input/cdio_paranoia: pass byte order swapping to the PCM "decoder"
...
Send another "magic" MIME type when the byte order must be reversed.
This also fixes byte order issues when big-endian was involved (input
data or host byte order) - that was completely broken.
2011-10-10 10:13:43 +02:00
Max Kellermann
2be245b75e
input/soup: wait some more before resuming the stream
2011-09-16 21:50:05 +02:00
Max Kellermann
17927f5c26
input/soup: improve error messages
...
Copy the reason_phrase from the SoupMessage, and check for transport
errors in the session callback.
2011-09-16 21:50:05 +02:00
Max Kellermann
754f26a97c
input_stream: non-blocking I/O
...
Add GMutex, GCond attributes which will be used by callers to
conditionally wait on the stream.
Remove the (now-useless) plugin method buffer(), wait on GCond
instead. Lock the input_stream before each method call. Do the same
with the playlist plugins.
2011-09-16 21:22:13 +02:00
Max Kellermann
29241c4f83
input_plugin: add method check()
...
To check for errors without reading. The decoder thread wants to do
that, before it passes the input stream to the plugin.
2011-09-16 21:22:02 +02:00
Max Kellermann
6f655eb9b9
input/{soup,curl}: free unused postponed_error
...
Fix memory leak.
2011-09-16 21:13:25 +02:00
Max Kellermann
65dfd90141
input/soup: move libsoup calls to the I/O thread
...
libsoup's asynchronous API is not thread safe. By moving the calls
into the I/O thread, several crash bugs will be fixed.
2011-09-16 20:34:47 +02:00
Max Kellermann
59abdbd2dd
input/soup: wait for _cancel_message() to complete
...
Add the "complete" attribute, and set it in _session_callback().
_close() waits for it to become true.
2011-09-16 20:34:47 +02:00
Max Kellermann
a6d6873856
input/soup: return real GErrors to the caller
...
Add attribute postponed_error, pass this GError to the caller.
2011-09-16 11:36:09 +02:00
Max Kellermann
e99df3a3be
input/soup: set the "ready" flag on failure
...
Fix deadlock.
2011-09-16 11:35:02 +02:00
Max Kellermann
8b657255cc
input/soup: remove redundant flag "ready"
...
We'll add proper locking now, and there's no need to carry this
duplicate flag.
2011-09-16 11:34:50 +02:00
Max Kellermann
0e1dc79321
input/soup: report failure in _read()
...
To report failures to callers who don't use _buffer().
2011-09-16 11:30:56 +02:00
Max Kellermann
0ef15e5fac
input/soup: unlock before cancelling the soup message
...
Avoid recursive deadlock in _session_callback().
2011-09-16 11:30:30 +02:00
Max Kellermann
b513943893
input/curl: wait some more before resuming the stream
...
Pausing and resuming after every little chunk adds lots of overhead.
Add a lower level for resuming the stream.
2011-09-16 09:14:29 +02:00
Max Kellermann
edffc56600
input/curl: clear the "paused" flag before resuming
...
curl_easy_pause(CURLPAUSE_CONT) may have added enough data to go into
pause again.
2011-09-16 09:11:15 +02:00
Max Kellermann
856b0e6886
input/curl: remove _schedule_update()
...
Call _update_fds() directly. This is possible because it's only
called from within the I/O thread.
2011-09-16 09:11:09 +02:00
Max Kellermann
bf1eb46b87
input/curl: unlock the mutex for io_thread_call()
...
Fix deadlock.
2011-09-16 09:10:39 +02:00
Max Kellermann
53174ea45f
input/soup: fix "unused local variable" warnings
2011-09-16 09:10:33 +02:00
Max Kellermann
87b624f5d5
Merge branch 'v0.16.x'
2011-09-16 07:52:39 +02:00
Max Kellermann
1cbba4fc59
input/curl, output/pulse: fix "unused local variable" warnings
2011-09-16 07:41:41 +02:00
Max Kellermann
f804a739b1
Merge branch 'v0.16.x'
...
Conflicts:
NEWS
configure.ac
2011-09-15 21:48:33 +02:00
Max Kellermann
48a84ca23e
input/rewind: copy the MIME type only once
...
Reduce heap usage by reducing the number of malloc() / free() calls.
2011-09-15 20:24:15 +02:00
Max Kellermann
8751783a1b
input/curl: per-request mutex/cond
...
The global data structures are now lock-free, because they are
accessed only from the I/O thread. By using per-request locks, we
have finer grained locking, preparing for locks shared with the
client.
2011-09-15 10:24:50 +02:00
Max Kellermann
3a2ec50d5f
input/curl: move all libCURL calls to the I/O thread
...
This adds some overheads for indirect calls to the I/O thread, but
reduces the amount of global locks. Next step will be switching to
per-request locks.
2011-09-15 09:48:36 +02:00
Max Kellermann
ce9aeed4cb
input/file: return NULL instead of "false"
2011-09-15 09:48:36 +02:00
Max Kellermann
e96f8c0444
input/curl: don't set "ready" on _easy_free()
...
Move the assignment to _request_done(), right before the GCond is
signalled. This might fix spurious wakeups.
2011-09-15 09:27:16 +02:00
Max Kellermann
2bf3bc3e10
input/curl: add assertions on io_thread_inside()
2011-09-15 09:27:15 +02:00
Max Kellermann
28143f86f9
input/curl: merge _request_abort() into _request_done()
...
This is a trivial function. Merge some duplicate code, e.g. the
g_cond_broadcast() call.
2011-09-15 09:27:13 +02:00
Max Kellermann
46ed717af4
input/curl: API documentation fix
2011-09-15 06:44:20 +02:00
Max Kellermann
ad37c88f80
input_plugin: add method update()
...
Update the struct attributes, important for facades like the "rewind"
plugin. To replace buffer().
2011-09-14 22:25:29 +02:00
Max Kellermann
dd33317f45
input_stream: move input_stream_init(), _deinit() to _internal.c
2011-09-14 22:01:55 +02:00
Max Kellermann
6a3008d7ff
Merge branch 'v0.16.x'
...
Conflicts:
configure.ac
src/output_control.c
2011-09-01 19:19:42 +02:00
Max Kellermann
11626e48bf
input/curl: implement a hard-coded timeout of 10 seconds
...
Be sure to stop the operation at some point when the server isn't
responding.
2011-08-26 19:28:09 +02:00
Max Kellermann
4f021cbced
input/curl: use the I/O thread
...
Background buffering and better timeout handling. This patch sort of
obsoletes the input_plugin method buffer().
2011-08-25 19:20:57 +02:00
Max Kellermann
ba31d176c8
input/curl: eliminate attribute "eof"
...
Assume the flag is true when the "easy" CURL handle is NULL. That
way, we don't need to keep track if CURL has sent us the "DONE"
information yet.
2011-08-25 19:20:28 +02:00
Max Kellermann
68edbc3e4a
input/curl: release "easy" CURL handle as early as possible
...
Release it immediately when end-of-file has been reached. We don't
need that handle anymore, because the rest is delivered from the
buffers.
2011-08-25 19:19:31 +02:00
Max Kellermann
5068227a46
input/curl: move code to input_curl_flush_buffers()
...
Allow closing the handle while preserving the remaining buffers.
2011-08-25 18:48:05 +02:00
Max Kellermann
f8f3bc89e7
input/curl: pass input_curl to fill_buffer()
...
Remove a cast.
2011-08-25 18:43:26 +02:00
Max Kellermann
37c8f5c1da
input/curl: set GError when init() fails
...
Let the caller know what happened, he's responsible for logging.
2011-08-25 08:43:05 +02:00
Max Kellermann
5bba2df526
input/soup: free all resources in method close()
2011-08-24 19:31:59 +02:00
Max Kellermann
3b9ffea36f
input/soup: new input plugin based on libsoup
...
To demonstrate the new I/O thread. libsoup is well-integrated into
the GLib main loop, which made this plugin pretty easy to write.
As a side effect, we have to initialize the I/O thread in all debug
programs that use the input API.
2011-08-24 03:33:49 +02:00
Max Kellermann
523f89cc8c
input/curl: remove obsolete function input_curl_reinit()
2011-08-24 02:55:05 +02:00
Max Kellermann
5ecb6fecc4
Merge branch 'v0.16.x'
2011-08-24 01:47:10 +02:00
Max Kellermann
8d70f808d9
input/curl: limit the receive buffer size
2011-08-23 20:46:51 +02:00
Skottish
e54748d355
decoder/ffmpeg: use AVIO_FLAG_READ on newer ffmpeg versions
...
FFmpeg/libav have dropped AVIO_RDONLY in favor of AVIO_FLAG_READ. This
patch fixes that in MPD.
2011-07-03 15:17:44 +02:00
Max Kellermann
98acf3f281
input/ffmpeg: use the new AVIOContext API
...
URLContext is deprecated.
2011-05-09 21:23:24 +02:00
Anton Khirnov
9d91aa23e6
decoder/ffmpeg: drop support for pre-0.5 ffmpeg
...
All modern distros ship 0.5, so there's no need to support old and buggy
ffmpeg versions.
2011-04-12 08:14:14 +02:00
Simon Kagstrom
124d1a5942
input: Add despotify input plugin
...
For Spotify tracks. Uses a spt URI, so with mpc you can play tracks
with e.g.,
mpc add spt://spotify:track:5qENVY0YEdZ7fiuOax70x1
mpc play
Uses the pcm_decoder_plugin for the output
2011-03-29 17:01:16 +02:00
Max Kellermann
c6cbcc2c25
copyright year 2011
2011-01-29 10:13:54 +01:00
Ian Zimmerman
27aa34d4ae
input/curl: enable CURLOPT_NETRC
...
I wanted mpd to play a mp3 stream from a music website. The stream is
only available to subscribers, which restriction is enforced through
normal http authentication. However, the URL I get from the website
is not the final URL of the stream, but a generic URL which points to
the real one through a redirect (code 301). Thus, I cannot predict
the final URL, and so I cannot use the username:password hack to force
the authentication, and mpd (libcurl on mpds behalf) fails to grab the
stream.
libcurl allows the option CURLOPT_NETRC to be set and then the
credentials can be stored in the good old .netrc file (in this case it
would be ~mpd/.netrc, of course). But mpd doesn't set this option. I
think it should.
2011-01-29 08:43:30 +01:00
Max Kellermann
cf696ce443
input/cdio_paranoia: add module name
...
Seems like we forgot to give this module a name... this can crash MPD
on startup.
2011-01-08 18:27:57 +01:00
Max Kellermann
4783ebc918
input/cdda: rename plugin to "cdio_paranoia"
2010-12-22 09:43:57 +01:00
Max Kellermann
8bda52783b
input/cdda: support reading the whole disc
2010-12-22 09:43:53 +01:00
Max Kellermann
07feec7ea6
input/cdda: remove unused function input_cdda_archive_extract_trackno()
2010-12-22 09:43:49 +01:00
Max Kellermann
e7471f589a
input/cdda: import missing pcm16_to_wave() from the wave encoder
2010-12-22 09:43:47 +01:00
Max Kellermann
24208be5cf
input/cdda: implement parse_cdda_uri()
...
Was missing.
2010-12-22 09:43:41 +01:00
Max Kellermann
8db5f66498
input/cdda: call input_cdda_close() with an input_stream pointer
...
Another build fix.
2010-12-22 09:43:27 +01:00
Max Kellermann
be670bfd1f
input/cdda: move code to cdda_detect_drive()
2010-12-22 09:43:20 +01:00
Max Kellermann
19acf090ed
input/cdda: remove newlines from error messages
2010-12-22 09:43:16 +01:00
Max Kellermann
2de7f6b457
input/cdda: remove debug code
2010-12-22 09:42:10 +01:00
Max Kellermann
a2e265e9a2
input/cdda: some general build failure fixes
2010-12-22 07:44:56 +01:00
Viliam Mateicka
28d7b29d72
input_cdda_plugin: new plugin to handle cdda:// protocol to access CD-DA audio CD's
2010-12-22 07:36:14 +01:00
Max Kellermann
f384f8da93
Merge release 0.15.15 from branch 'v0.15.x'
...
Conflicts:
NEWS
configure.ac
2010-11-08 18:50:22 +01:00
Max Kellermann
ad52eb236d
input/rewind: fix assertion failure
...
The assertion added in MPD 0.15.14 was too much, it failed when the
MIME type of a stream was NULL.
2010-11-08 10:37:09 +01:00
Max Kellermann
4478b3ef74
Merge release 0.15.14 from branch 'v0.15.x'
...
Conflicts:
NEWS
configure.ac
src/decoder_control.c
src/decoder_control.h
src/input/rewind_input_plugin.c
src/output_control.c
src/output_thread.c
src/player_thread.c
2010-11-07 15:30:18 +01:00
Max Kellermann
32d10eedbd
input/rewind: remove redundant NULL check before g_free() call
2010-11-05 18:40:14 +01:00
Max Kellermann
dfd98eede7
input/rewind: add two assertions
2010-11-05 18:40:07 +01:00
Max Kellermann
a728d7a026
input/rewind: fix double free bug
...
Duplicate the "mime" attribute of the inner input_stream object,
instead of copying the pointer.
2010-11-05 18:39:40 +01:00
Max Kellermann
a57f9e712d
Merge release 0.15.13 from branch 'v0.15.x'
...
Conflicts:
NEWS
configure.ac
src/input/rewind_input_plugin.c
src/output/httpd_output_plugin.c
2010-10-11 20:33:17 +02:00
Thomas Jansen
e3f4c7b91c
input/rewind: enable for MMS
2010-09-28 12:56:47 +02:00
Thomas Jansen
54294366d5
rewind_input_plugin: Update MIME not only once
...
The assumption that MIME type is set only once is not valid with CURL,
as URL redirections may update the MIME type.
This fixes bug #3044 .
2010-09-23 20:39:13 +02:00
Max Kellermann
589bb54111
input/curl: fix version check for curl_multi_timeout()
...
According to the CURL web site, curl_multi_timeout() was added in
version 7.15.4:
http://curl.haxx.se/libcurl/c/curl_multi_timeout.html
2010-09-07 21:40:56 +02:00
Max Kellermann
c0da938d4f
Merge release 0.15.12 from branch 'v0.15.x'
...
Conflicts:
NEWS
configure.ac
2010-07-20 23:03:06 +02:00
Max Kellermann
1f976d6e54
input/curl: remove assertion after curl_multi_fdset()
...
Some users reported that MPD crashes when using a new CURL version
with the threaded DNS resolver enabled. It seems that
curl_multi_fdset() returns no file descriptor when the DNS resolver
runs in another thread, so MPD does not have any event to wait for.
On the CURL mailing list, somebody suggested to sleep for a fixed
amount of time. This is not an elegant solution, because daemons
should never have to sleep without waiting for an event. I hope the
CURL developers will review the API and remove the threaded DNS
resolver.
Meanwhile, I'm removing the assertion in question, to allow those
unfortunate users running the latest CURL version to continue using
MPD.
2010-07-20 22:55:13 +02:00
Max Kellermann
a4908dca42
input/curl: query timeout from CURL
...
Use curl_multi_timeout() to determine the select() timeout, instead of
hard-coding one second.
2010-07-20 22:37:34 +02:00
Max Kellermann
9dda53e1d2
Merge release 0.15.10 from branch 'v0.15.x'
...
Conflicts:
NEWS
configure.ac
src/input/mms_input_plugin.c
2010-05-30 18:26:33 +02:00
Max Kellermann
c727e86980
input/file, output/{fifo,recorder}: add O_BINARY to open() flags
...
Windows compatibility.
2010-05-20 09:13:39 +02:00
Max Kellermann
fa2ff849c5
input/ffmpeg: new input plugin using libavformat's "avio" library
2010-05-18 21:20:31 +02:00
Max Kellermann
6b2b91ff01
input/mms: removed empty method buffer()
...
input_stream_buffer() has a check for "buffer==NULL", so we don't need
an explicit empty implementation.
2010-05-18 21:20:31 +02:00
Max Kellermann
28736414a8
input/mms: initialize the "eof" attribute
2010-05-18 21:11:00 +02:00
Max Kellermann
e98bd55cbf
input/mms: fix memory leak in error handler
2010-05-18 20:57:57 +02:00
Max Kellermann
9cb7760c5e
input_stream: added attribute "uri"
2010-01-18 10:18:41 +01:00
Max Kellermann
fb9bd53328
input_stream: added function input_stream_deinit()
...
All close() implementations must call this method.
2010-01-18 09:57:53 +01:00
Max Kellermann
2f8135ef8b
input/rewind: enable the "rewind" wrapper for all non-seekable streams
...
Don't limit the "rewind" input plugin to CURL streams.
2010-01-04 21:45:32 +01:00
Max Kellermann
d3b763a48c
input_stream: return allocated input_stream objects
...
Major API redesign: don't let the caller allocate the input_stream
object. Let each input plugin allocate its own (derived/extended)
input_stream pointer. The "data" attribute can now be removed, and
all input plugins simply cast the input_stream pointer to their own
structure (with an "struct input_stream base" as the first attribute).
2010-01-01 17:25:07 +01:00
Avuton Olrich
9d3865cb95
Update copyright notices.
2009-12-31 20:58:43 -08:00
Max Kellermann
aad05fd138
archive: use reference counting for archive+input
...
Make the input_stream implementation hold a reference on the
archive_file object. Allow the caller to "close" the archive_file
object immediately, no matter if the open_stream() method has
succeeded or not.
2009-12-31 18:27:35 +01:00
Max Kellermann
0cc3b98bd9
input/archive: don't initialize input_stream.ready
...
The archive plugin should decide this.
2009-12-31 16:26:34 +01:00
Max Kellermann
efc885a9dc
Merge vorbis+icy fixes from branch 'v0.15.x'
...
Conflicts:
Makefile.am
NEWS
configure.ac
src/input/curl_input_plugin.c
src/input_stream.c
2009-12-30 23:24:11 +01:00
Max Kellermann
4419e5b90d
input/curl: removed the built-in rewinding code
...
This has been reimplemented in the "rewind" input plugin.
2009-12-30 22:52:24 +01:00
Max Kellermann
c88f95a2ea
input/rewind: new input_stream wrapper to allow stream rewinding
...
This replaces the rewinding buffer code from the CURL input plugin.
It is more generic, and allows rewinding even when the server sends
Icy-Metadata (which would have been too difficult to implement within
the CURL plugin).
This is a rather complex patch for the stable branch (v0.15.x), but it
fixes a serious problem: the "vorbis" decoder plugin was unable to
play streams with Icy-Metadata, because it couldn't rewind the stream
after detecting the codec (Vorbis vs. FLAC).
2009-12-29 23:55:40 +01:00
Max Kellermann
71fee09744
archive_plugin: use GError in the open() method
2009-12-16 17:10:19 +01:00
Max Kellermann
f9af1a445e
input/archive: check for archive_file_open() errors
...
This fixes a NULL pointer dereference in case of archive plugin
failure.
2009-12-16 17:10:15 +01:00
Max Kellermann
0bc8c0c1da
archive_plugin: wrap method calls
...
Make archive_file a "real" struct, extended by all plugins. Add the
plugin pointer to it. Wrap all method calls in functions.
2009-12-16 17:09:58 +01:00
Max Kellermann
228b03edf8
input_stream: return errors with GError
2009-12-15 23:12:11 +01:00
Max Kellermann
b12072e6d9
input/archive: use g_path_is_absolute()
...
.. instead of manually checking pathname[0]=='/'.
g_path_is_absolute() is portable.
2009-12-15 21:26:16 +01:00
Max Kellermann
530e480748
Merge branch 'v0.15.x'
...
Conflicts:
src/archive/bz2_plugin.c
src/archive_api.h
src/input/file_input_plugin.c
test/run_input.c
2009-12-15 20:26:38 +01:00
Max Kellermann
2234d491b7
input/archive: close the archive file on error
...
Fixed memory leak in error handler.
2009-12-15 19:41:00 +01:00
Max Kellermann
f01d7d230b
input/file: don't fall back to parent directory
...
This code has never made any sense, and has broken some of the archive
plugin.
2009-12-15 19:16:28 +01:00
Max Kellermann
95c3f283ea
input/file: don't fall back to parent directory
...
This code has never made any sense, and has broken some of the archive
plugin.
2009-12-15 19:03:11 +01:00
Max Kellermann
786c1f035f
input_plugin: method init() returns errors with GError
...
Not used by any plugin currently, but this eliminates the g_error()
call in input_plugin_config(), so it's worth it.
2009-12-14 23:16:18 +01:00
Max Kellermann
5b82ffc291
include config.h in all sources
...
After we've been hit by Large File Support problems several times in
the past week (which only occur on 32 bit platforms, which I don't
have), this is yet another attempt to fix the issue.
2009-11-12 09:17:03 +01:00
Max Kellermann
b722d3d7f3
configure.ac: require GLib 2.12
...
Drop the required GLib version from 2.16 to 2.12, because many current
systems still don't have GLib 2.16. This requires several new
compatibility functions in glib_compat.h.
2009-11-10 21:14:22 +01:00
Max Kellermann
8c0680f6b9
input/lastfm: fixed variable name in GLib<2.16 code path
...
Should be "lastfm_user", not "lastfm_username".
2009-11-10 20:54:17 +01:00
Max Kellermann
e0e6813a1d
fd_util: removed creat_cloexec()
...
Add a "mode" argument to open_cloexec() instead.
2009-11-10 16:53:24 +01:00
Max Kellermann
e3af0032b2
set the close-on-exec flag on all file descriptors
...
Added the "fd_util" library, which attempts to use the new thread-safe
Linux system calls pipe2(), accept4() and the options O_CLOEXEC,
SOCK_CLOEXEC. Without these, it falls back to FD_CLOEXEC, which is
not thread safe.
This is particularly important for the "pipe" output plugin (and
others, such as JACK/PulseAudio), because we were heavily leaking file
descriptors to child processes.
2009-11-07 18:55:16 +01:00
Max Kellermann
c953d6409d
mapper, update, ...: use g_build_filename(), G_DIR_SEPARATOR, ...
...
Try to be as portable as possible, use GLib path name functions and
macros.
2009-10-20 21:01:55 +02:00
Max Kellermann
1ff101c568
input/lastfm: removed obsolete last.fm input plugin
...
This has been replaced by the last.fm playlist plugin. The input
plugin has never worked well, and was just a playground to experiment
with the last.fm radio protocol.
2009-10-13 19:43:56 +02:00
Max Kellermann
a61d0c9567
Merge branch 'v0.15.x'
2009-10-13 16:25:17 +02:00
Max Kellermann
6037beabe1
input/curl: fixed endless loop during buffering
...
When the connection is lost while buffering, the CURL input plugin may
enter an endless loop, because it does not check the EOF condition.
This patch makes fill_buffer() return success only if there's at least
one buffer, which is enough of a check.x
2009-10-13 16:24:28 +02:00
Max Kellermann
ea616b3ed4
tag: removed the "_ITEM_" suffix from the enum names
2009-10-13 16:12:45 +02:00
Max Kellermann
4390d72b14
configure.ac: require GLib 2.16
...
Accidently, MPD has been using several GLib 2.16 functions for a
while, and nobody noticed yet. To simplify the code base, let's bump
the minimum GLib version for MPD to 2.16. That version is old enough,
and it's reasonable to expect users to have it.
2009-10-13 16:12:43 +02:00
Max Kellermann
727c301fbc
input_stream: use "goffset" instead of "off_t"
...
The "off_t" type may change when you enable or disable large file
support on 32 bit platforms. This caused severe ABI problems within
MPD when we enabled LFS for the first time: two sources included
config.h and sys/types.h in different order, and had different off_t
sizes - leading to memory corruption because of ABI incompatibility.
This patch attempts to get rid of all public "off_t" uses: it removes
"off_t" from the input_stream ABI/API, and switches to GLib's 64 bit
"goffset" type. This may hurt 32 bit embedded platforms a tiny bit,
but that's not even measurable.
2009-10-11 23:32:22 +02:00
Max Kellermann
71f881d5cb
Merge branch 'v0.15.x'
...
Conflicts:
NEWS
configure.ac
2009-10-11 23:25:27 +02:00
Max Kellermann
af92b1c2d8
input/curl: don't abort if a packet has only metadata
...
When a received chunk of data has only icy-metadata, there was no
usable data left for input_curl_read() to return, and thus it returned
0 bytes. "0" however is a special value for "end of file" or
"error". This patch makes input_curl_read() read more data from the
socket, until the read request can be fulfilled (or until there's
really EOF).
2009-10-11 23:13:49 +02:00
Max Kellermann
016558093b
input/curl: moved code to fill_buffer()
2009-10-11 23:09:38 +02:00
Max Kellermann
7013f9fc31
Merged release 0.15.4 from branch 'v0.15.x'
...
Conflicts:
NEWS
configure.ac
2009-10-03 16:17:02 +02:00
Serge Ziryukin
82c6c13780
input/mms: fix G_LOG_DOMAIN value
2009-09-20 23:28:29 +02:00
Courtney Cavin
614a011845
input/lastfm: Ensure multiple identical xml entities are decoded.
...
Previously, if two identical entities appeared in one string, only the
first would get decoded. This fixes that bug.
2009-07-28 16:40:52 -04:00
Courtney Cavin
6d71094ce5
input/lastfm: use metadata
...
Added a patch to flush out the last.fm input plugin slightly. It
basically turns it into a wrapper for the appropriate plugin. Most
notably metadata is now extracted.
2009-07-28 16:41:50 +02:00
Mathieu Rochette
0dedfe7ddc
input/file: log message on error
...
If a file is removed the library, next time mpd will try to play it it
will result in an error 'ERROR: problems decoding some/file.ogg'.
Nothing is written in log files (verbose mode or not)
[mk: append strerror(errno)]
2009-05-28 23:46:19 +02:00
Max Kellermann
0edfbc8a5f
input_curl: use g_ascii_strcasecmp() instead of strcasecmp()
...
strcasecmp() is locale dependent, making it a bad choice for internal
string comparisons.
2009-04-28 09:30:12 +02:00
Max Kellermann
11bcd7f013
curl: moved proxy settings to "input" block
...
The old global settings "http_proxy_host", "http_proxy_port",
"http_proxy_user" and "http_proxy_password" continue to work.
2009-04-25 13:35:04 +02:00
Sean McNamara
37531f6f1e
Add winsock2 headers for curl's use of select() on sockets
2009-03-27 18:03:03 +01:00
Avuton Olrich
0aee49bdf8
all: Update copyright header.
...
This updates the copyright header to all be the same, which is
pretty much an update of where to mail request for a copy of the GPL
and the years of the MPD project. This also puts all committers under
'The Music Player Project' umbrella. These entries should go
individually in the AUTHORS file, for consistancy.
2009-03-13 11:51:55 -07:00
Jochen Keil
ab3d89f484
decoder_plugin: added method container_scan()
...
[mk: fixed whitespace errors; use delete_song() instead of
songvec_delete()]
2009-03-09 07:58:26 +01:00
Max Kellermann
5e0acec118
curl: reverse GLIB_CHECK_VERSION()
...
The GLIB_CHECK_VERSION() macro was used improperly, which broke build
on GLib < 2.14. Add a "!" for negation.
2009-03-06 15:42:33 +01:00
Max Kellermann
4220e6b0ad
input_lastfm: new input plugin for last.fm radio
...
The lastfm input plugin enables MPD to play lastfm:// URLs. This
plugin is not complete yet: it plays only the first song in the
last.fm playlist, and the playlist parser isn't even implemented
properly.
2009-03-02 23:11:31 +01:00
Max Kellermann
cfb350f4f0
input: pass config_param to input_plugin.init()
...
Allow input plugins to configure with an "input" block in mpd.conf.
Also allow the user to disable a plugin completely.
2009-03-02 23:08:17 +01:00
Max Kellermann
9a350acf04
input_plugin: added methods init(), finish()
...
Instead of hard-coding the plugin global initialization in
input_stream_global_init(), make it walk the plugin list and
initialize all plugins.
2009-03-02 20:45:50 +01:00
Max Kellermann
36d24fb7ea
input: moved plugins to ./src/input/
...
Create a sub directory for input plugins.
2009-03-02 20:40:31 +01:00