Max Kellermann
74617389c8
output_plugin: the plugin allocates the audio_output object
...
Pass audio_output objects around instead of void pointers. This will
give some more control to the plugin, and prepares for non-blocking
audio outputs.
2011-09-19 09:41:21 +02:00
Max Kellermann
1d8840412f
configure.ac: add option --enable-solaris-output
...
Allow enabling the plugin explicitly without running Solaris, to test
the build.
2011-09-19 09:39:35 +02:00
Max Kellermann
ffa9f4b47f
output/roar: check return values
...
Fixes gcc warnings.
2011-09-18 12:07:06 +02:00
Max Kellermann
667e22bbc7
output/roar: unknown volume is -1, not 0
2011-09-18 12:06:46 +02:00
Max Kellermann
d4d838c8bb
output/roar: move code to roar_cancel_locked() and others
...
Wrap the locking code.
2011-09-18 11:51:18 +02:00
Max Kellermann
c61a889c86
output/roar: use GLib memory allocation functions
...
GLib has a built-in OOM handler.
2011-09-17 20:12:45 +02:00
Max Kellermann
567fe89a77
output/roar: use config_get_block_string() for temporary
2011-09-17 20:11:51 +02:00
Max Kellermann
950772ab8a
output/roar: reorder methods
2011-09-17 20:10:26 +02:00
Max Kellermann
0bd0e2a3ec
output: rename plugin variables
...
Consistent naming.
2011-09-17 20:04:18 +02:00
Max Kellermann
47774ce882
Merge branch 'v0.16.x'
2011-09-17 19:59:52 +02:00
Max Kellermann
3c9bcdd347
output: per-plugin header
...
Move the "extern" declarations from output_list.c, for more type
safety.
2011-09-17 19:51:41 +02:00
Max Kellermann
3934d2d30c
output/pulse: don't expose internal struct in public header
...
Provide _lock() and _unlock() to wrap all accesses from the mixer
plugin.
2011-09-17 19:50:36 +02:00
Max Kellermann
423ce9557a
output/raop: don't expose internal structs in public header
2011-09-17 19:44:30 +02:00
Max Kellermann
947848ebf6
output/roar: export volume methods
...
Use these instead of exposing the internal roar_t struct.
2011-09-17 19:33:51 +02:00
Max Kellermann
5e22fe488e
output: rename plugin source files
2011-09-17 08:54:50 +02:00
Max Kellermann
c666cf1c44
output/pulse: move code to _setup_stream()
2011-09-17 08:53:53 +02:00
Tim Harder
79435dbdec
decoder/audiofile: include stdio header for SEEK_* defines
...
The stdio header is no longer pulled in by af_vfs.h in audiofile-0.3.0.
2011-09-17 07:33:42 +02:00
Max Kellermann
27206368da
output/pulse: improve locking
...
Always lock the main loop when operating on PULSE objects. Document
this.
2011-09-17 07:30:59 +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
9ea8a840a9
decoder_api: remove the loop from decoder_read()
...
This was useless, because input_stream_read() blocks until data is
available. Calling it in a loop doesn't make sense.
2011-09-16 09:15:10 +02:00
Max Kellermann
7b88089593
decoder_api: move code to decoder_check_cancel_read()
2011-09-16 09:15:10 +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
e1efc71ad3
input_stream: add "nonnull" attributes
2011-09-15 22:40:44 +02:00
Max Kellermann
f804a739b1
Merge branch 'v0.16.x'
...
Conflicts:
NEWS
configure.ac
2011-09-15 21:48:33 +02:00
Max Kellermann
2ed870c854
decoder/ffmpeg: flush the codec after seeking
...
Let the codec start with fresh buffers. This should fix the remaining
seeking issues.
2011-09-15 21:41:25 +02:00
Max Kellermann
ce35ba9ac9
decoder/ffmpeg: explicitly specify the current stream for seeking
...
Use AVStream.time_base to convert the decoder_seek_where() value, and
pass the current stream number to av_seek_frame().
2011-09-15 21:35:29 +02:00
Max Kellermann
724a59aaf7
decoder/ffmpeg: don't require key frame for seeking
...
Use flag AV_TIME_BASE.
2011-09-15 21:32:29 +02:00
Max Kellermann
42d8c2981f
decoder/ffmpeg: higher precision timestamps
2011-09-15 21:30:27 +02:00
Max Kellermann
9aa91e0f17
decoder/ffmpeg: move formula to time_from_ffmpeg()
2011-09-15 21:23:48 +02:00
Max Kellermann
5aabee8996
decoder/ffmpeg: add local variable "av_stream"
...
Code simplification.
2011-09-15 21:14:53 +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
76ec3d3248
udp_server: disable -Wmissing-field-initializers
2011-09-15 09:25:53 +02:00
Max Kellermann
d0c85a5a96
gcc.h: add macro GCC_CHECK_VERSION
2011-09-15 09:22:48 +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
8c6e8a6eb8
input_internal: add assertions
2011-09-14 22:06:57 +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
c344d63fb3
decoder_internal: don't call input_stream_buffer()
...
This is not necessary since all relevant input plugins have been moved
to the I/O thread, and there is no remaining useful buffer()
implementation. This also fixes a busy loop when playing radio.
2011-09-14 09:41:27 +02:00
Max Kellermann
a236a439cc
db_print: move code to function db_selection_print()
...
Use it in handle_lsinfo(), and eliminate some duplicate code.
2011-09-13 22:09:37 +02:00
Max Kellermann
c779e2674a
db_visitor: add method playlist()
2011-09-13 22:02:37 +02:00
Max Kellermann
a94d4be466
db_plugin: add method visit()
2011-09-13 21:47:00 +02:00
Max Kellermann
b7d2d4cfe8
database: don't allow uri==NULL
...
Add nonnull attributes and fix all callers.
2011-09-13 21:39:07 +02:00
Max Kellermann
a6c797ee4b
gcc.h: add macro gcc_nonnull
2011-09-13 21:38:27 +02:00
Max Kellermann
3e40b2249f
gcc.h: change "mpd_" prefix to "gcc_"
...
This is specific to gcc, not to mpd.
2011-09-13 21:37:33 +02:00
Max Kellermann
2fe1b5034d
db_plugin: add method get_song()
...
New db_get_song() implementation.
2011-09-13 21:01:35 +02:00
Max Kellermann
b4430839a3
database: generate GError when database is disabled
2011-09-13 20:54:27 +02:00
Max Kellermann
412cf974a4
directory: don't visit "self" in _walk()
...
Let the caller decide if the current directory should be visited.
2011-09-13 20:44:35 +02:00
Max Kellermann
3fc6beeff0
locate: remove unused function locate_item_new()
2011-09-13 20:44:00 +02:00
Max Kellermann
2ff35c8bfa
directory: don't require a "directory" visitor
...
.. to recurse. A visitor may not have one, but still be interested in
a recursive search.
2011-09-13 20:44:00 +02:00
Max Kellermann
169db88c20
database: add struct db_visitor
...
Use this struct for db_walk().
2011-09-13 19:37:28 +02:00
Max Kellermann
ca419c84b8
stored_playlist: return GError, code is playlist_result
...
Improve error reporting and handling. command.c gets the new function
print_error(), which sends a GError to the client.
2011-09-11 07:57:50 +02:00
Max Kellermann
aede71b1dc
playlist: move enum playlist_result to playlist_error.h
...
Reduce header dependencies.
2011-09-11 07:55:51 +02:00
Max Kellermann
14d573cbf1
playlist: move PLAYLIST_COMMENT to stored_playlist.c
...
Only used there.
2011-09-11 07:55:19 +02:00
Max Kellermann
7819aa6b20
db_plugin: introducing a plugin API for the song database
...
First draft, not really pluggable currently - hard-coded to use the
"simple" plugin, and calls several of its internal functions.
The API is very simple currently, all searches are still performed
over the root "directory" object. Future changes to the API will move
those search implementations into the plugin, to allow more efficient
implementations, or implementations that don't have the whole tree in
memory all the time.
2011-09-10 07:58:43 +02:00
Max Kellermann
7cc6b63aac
database: move code to db_save.c
2011-09-10 07:48:05 +02:00
Max Kellermann
4af6362751
directory_save: pass const pointer to _save()
2011-09-10 07:48:05 +02:00
Max Kellermann
d54075197f
tag_internal: add missing tag.h include
...
For TAG_NUM_OF_ITEM_TYPES.
2011-09-10 07:48:05 +02:00
Max Kellermann
5cce56199b
conf: export config_param_free()
2011-09-09 23:59:46 +02:00
Max Kellermann
3cc12817f6
conf: _get_next_param() returns a const pointer
...
No writers.
2011-09-09 23:59:46 +02:00
Max Kellermann
68875ba600
database: return GError on failure
2011-09-09 23:28:27 +02:00
Max Kellermann
9f5c938ff3
conf: add config_dup_block_path()
2011-09-09 23:01:22 +02:00
Max Kellermann
b42a8d2364
utils: parsePath() returns GError on failure
...
Better error messages.
2011-09-09 22:55:57 +02:00
Max Kellermann
61fc01e79e
utils: pass a const string to parsePath()
...
Remove the slash hack, allocate memory for the user name.
2011-09-09 22:55:57 +02:00
Max Kellermann
cceaec1d74
utils: eliminate local variable "pos"
...
Just advance the "path" pointer.
2011-09-09 22:55:57 +02:00
Max Kellermann
8e5f9c8160
conf: turn config_get_path() into config_dup_path()
...
config_get_path() was somewhat flawed, because it pretended to be a
function, when it really had a side effect. The second flaw was that
it did not return the parser error, instead it aborted the whole
process, which is bad style. The new function returns a duplicated
(modified) string that must be freed by the caller, and returns a
GError on failure.
2011-09-09 22:55:57 +02:00
Max Kellermann
c620fd42f4
glib_compat.h: emulate g_prefix_error()
2011-09-09 22:55:57 +02:00
Max Kellermann
2a859f870a
log: print detailed errno message on open() failure
2011-09-09 21:53:42 +02:00
Max Kellermann
b680753db8
log: return GError on initialization failure
2011-09-09 21:53:42 +02:00
Max Kellermann
35af940166
conf: get_block_param() returns a const pointer
...
No caller needs to write.
2011-09-09 21:36:41 +02:00
Max Kellermann
bc0fec0afe
conf: move duplicate check to _read_name_value()
...
config_add_block_param() cannot fail, which makes it easier to use.
2011-09-09 21:36:41 +02:00
Max Kellermann
e3eca82cc3
conf: move code to config_read_name_value()
...
Reduce indent.
2011-09-09 21:36:35 +02:00
Max Kellermann
e7651d0d0f
conf: add gcc optimization attributes
2011-09-09 21:01:19 +02:00
Max Kellermann
5cf4ce9318
pcm_format: fix 32-to-24 bit conversion (the "silence" bug)
...
D'oh, we were reading 16 bit integers instead of 32 bit integers!
That caused silence when trying to play a 32 bit input file on a 24
bit sound card (e.g. USB sound chips with 24 bit packed samples).
2011-09-08 23:47:32 +02:00
Max Kellermann
6a6f28668f
dbUtils: move code to db_print.c
2011-09-06 00:03:51 +02:00
Max Kellermann
dadf1339b5
dbUtils: pass player_control to findAddIn()
...
Allow calling findAddIn() without a client object.
2011-09-05 23:14:39 +02:00
Max Kellermann
3d3bca5338
decoder/oggflac: delete this obsolete plugin
...
libOggFLAC has been deprecated for 5 years now, and we havn't been
testing it for a long time. Let's delete it.
2011-09-01 19:29:04 +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