Commit Graph

5083 Commits

Author SHA1 Message Date
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
Max Kellermann
596f36bb78 output/osx: don't drain the buffer when closing
Eliminate an unnecessary source of deadlocks.
2011-09-01 18:21:46 +02:00
Max Kellermann
e7abdab58d output/osx: signal the GCond while mutex is locked 2011-09-01 18:21:46 +02:00
Max Kellermann
2be6184c8d output_all: move _lock_signal() to output_control.c
Better name, better documentation.
2011-09-01 07:59:15 +02:00
Max Kellermann
8b0b4ff086 output_thread: reimplement CANCEL synchronization
The output thread could hang indefinitely after finishing CANCEL,
because it could have missed the signal while the output was not
unlocked in ao_command_finished().

This patch removes the wait() call after CANCEL, and adds the flag
"allow_play" instead.  While this flag is set, playback is skipped.
With this flag, there will not be any excess wait() call after the
pipe has been cleared.

This patch fixes a bug that causes mpd to discontinue playback after
seeking, due to the race condition described above.
2011-09-01 07:13:21 +02:00
Max Kellermann
60f7ff3de5 output/pulse: reset callbacks before closing stream/context
Fixes assertion failure when a stream callback is invoked too late
after a format change.
2011-08-31 21:01:34 +02:00
Max Kellermann
e76c752987 output/pulse: add function _delete_stream()
Merge common code.
2011-08-31 21:01:22 +02:00
Max Kellermann
042c1abc6e output/pulse: use _delete_context()
Eliminate duplicate code.
2011-08-31 20:58:36 +02:00
Max Kellermann
1401621913 output/raop: remove Audio-Jack-Status check
The value of this is not used, the code is commented out - let's get
rid of it.
2011-08-31 20:19:36 +02:00
Max Kellermann
3c034b0a0c output/raop: remove empty function raopcl_stream_connect() 2011-08-31 20:17:24 +02:00
Max Kellermann
395191bd75 rtsp_client: use the I/O thread
Make the code portable.
2011-08-31 08:32:09 +02:00
Max Kellermann
ec7d8fb6bd udp_server: don't use MSG_DONTWAIT on WIN32
Doesn't exist on mingw32.
2011-08-31 08:32:09 +02:00
Max Kellermann
062948b110 mixer/raop: include cleanup 2011-08-31 08:31:26 +02:00
Max Kellermann
7f3dc5f040 output/raop: cast sendto() parameter to void pointer
Fix compilation on mingw32.
2011-08-31 08:30:26 +02:00
Max Kellermann
dd0798a317 rtsp_client: use g_usleep()
usleep() is not portable.
2011-08-31 08:30:26 +02:00
Max Kellermann
9209ccfa40 rtsp_client: allow parameter "kd" to be NULL
When the caller isn't interested in the values.
2011-08-31 08:16:55 +02:00
Max Kellermann
2525d32e17 rtsp_client: don't wait if packet is over due
Check if the time difference is negative.  That would have caused
sleeping forever.
2011-08-31 07:47:01 +02:00
Max Kellermann
f3ac8a7cd9 io_thread: allow _call() from inside the thread 2011-08-31 07:33:07 +02:00
Max Kellermann
f3d95f70e2 rtsp_client: free attribute "kd" in _close()
Fix yet another memory leak.
2011-08-31 07:13:42 +02:00
Max Kellermann
57526067f5 output/raop: move code to raop_session_new()
.. and fix a few memory leaks.
2011-08-30 22:36:54 +02:00
Max Kellermann
293836494d output_control: move code to audio_output_destruct()
.. and destruct the output object properly in test/run_output.
2011-08-30 22:28:15 +02:00
Max Kellermann
34d9d8abd4 output/raop: merge raopcl_close() into _finish()
.. and fix a double free bug.
2011-08-30 22:20:32 +02:00
Max Kellermann
bd67e986f4 output/raop: free the raop_data object in finish() 2011-08-30 22:02:55 +02:00
Max Kellermann
e587518d85 output/raop: remove from the session when opening fails 2011-08-30 22:00:19 +02:00
Max Kellermann
210b6c38bd output/raop: move code to raop_output_remove() 2011-08-30 21:56:57 +02:00
Max Kellermann
9592c0b466 rtsp_client: increment "dp" after terminating the string
This fixes a bug that caused all values to be an empty string.
2011-08-30 21:33:02 +02:00
Max Kellermann
a33537b2b9 rtsp_client: simplify whitespace elimination
Just move a pointer, don't call strlen() in every iteration.
2011-08-30 21:31:46 +02:00
Max Kellermann
81d5c9757c rtsp_client: check "new_kd" instead of "i"
Eliminate the redundant local variable "i".
2011-08-30 21:30:06 +02:00
Max Kellermann
f34124a50b rtsp_client: move "new_kd" out of the loop
This must persist iterations.
2011-08-30 21:29:19 +02:00
Max Kellermann
74a39c715b ntp_server: move code to udp_server.c 2011-08-30 07:39:05 +02:00
Max Kellermann
195496333b output/raop: move RTSP client code to rtsp_client.c
Restore some of the original file structure from from raop_play.
2011-08-29 11:27:08 +02:00
Max Kellermann
9ccaa90439 ntp_server: use the I/O thread 2011-08-29 11:23:51 +02:00
Max Kellermann
4733c5fef0 io_thread: add function io_thread_quit() 2011-08-29 10:25:04 +02:00
Max Kellermann
59a5b000e0 ntp_server: check for select() failures
Fix freeze after signal was handled.
2011-08-29 10:18:54 +02:00
Max Kellermann
d49a2ccb08 ntp_server: fix socket types
Cast recvfrom(), sendto() buffers to "void*" to avoid "char*" /
"unsigned char*" confusion.  Use ssize_t for the return value, and
socklen_t for the socket address size.
2011-08-29 09:52:51 +02:00
Max Kellermann
4a75acb46c io_thread: add function io_thread_run() 2011-08-29 09:52:03 +02:00
Max Kellermann
a769352a74 output/raop: fallback for g_set_error_literal()
This function was added in GLib 2.18.  Make the plugin compatible with
older GLib versions.
2011-08-29 09:39:03 +02:00
Max Kellermann
8a63c27925 output/raop: move NTP code to separate library 2011-08-28 16:44:12 +02:00
Jonathan Neuschäfer
310895f060 rename 'Timer' to 'struct timer' 2011-08-27 11:30:34 +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
635f7026b0 io_thread: add helper functions 2011-08-25 18:43:14 +02:00
Max Kellermann
0f1e4f0326 io_thread: move global variables into a struct 2011-08-25 18:43:05 +02:00
Max Kellermann
89355edb8a glib_compat.h: add g_timeout_source_new_seconds() 2011-08-25 18:42:44 +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
e242f3999c io_thread: new thread for non-blocking background I/O
Try to eliminate the remaining blocking I/O.
2011-08-24 02:55:05 +02:00
Max Kellermann
523f89cc8c input/curl: remove obsolete function input_curl_reinit() 2011-08-24 02:55:05 +02:00
Max Kellermann
0575a6d652 output/raop: use GLib byte order macros 2011-08-24 02:19:40 +02:00
Max Kellermann
08b88714e0 output/raop: use fill_int() in fill_time_...()
Eliminate duplicate code.
2011-08-24 02:18:51 +02:00
Max Kellermann
bcaff4b844 output/raop: check if the "host" option is present
Better than dereferencing NULL.
2011-08-24 01:47:31 +02:00
Max Kellermann
82f336a78f output/raop: remove excessive debug messages 2011-08-24 01:47:27 +02:00
Max Kellermann
350aa33022 output/raop: consistently use GError 2011-08-24 01:47:26 +02:00
Max Kellermann
d6290a2f1a output/raop: use GLib heap functions 2011-08-24 01:47:25 +02:00
Max Kellermann
71e9d08863 output/raop: functions that always succeed return void
No point in returning true, and checking that.
2011-08-24 01:47:23 +02:00
Max Kellermann
9729dc7594 output/raop: rtspcl_connect() returns false on error
.. and not -1, which is "true".
2011-08-24 01:47:22 +02:00
Max Kellermann
92c1b8f31e output/raop: error checking in send_control_command() 2011-08-24 01:47:21 +02:00
Max Kellermann
9ffa2604f8 output/raop: make some allocations static
Allocate objects on the stack to reduce heap overhead.
2011-08-24 01:47:20 +02:00
Max Kellermann
03b1fad4d4 output/raop: remove unused local variables 2011-08-24 01:47:18 +02:00
Max Kellermann
72eb4c534f output/raop: make some exec_request parameters const 2011-08-24 01:47:17 +02:00
Max Kellermann
47d936e9cc output/raop: use "char*" for string buffers
Not unsigned char.  Eliminate useless casts.
2011-08-24 01:47:15 +02:00
Max Kellermann
8e08407090 output/raop: make send_control_command() static
Only used internally.
2011-08-24 01:47:14 +02:00
Max Kellermann
c0a4558c62 output/raop: remove useless test_default_device() implementation
This defaults to "false" when the method pointer is NULL.
2011-08-24 01:47:13 +02:00
Max Kellermann
5ecb6fecc4 Merge branch 'v0.16.x' 2011-08-24 01:47:10 +02:00
Max Kellermann
b3df4dc2c9 output/pulse: fix deadlock when the stream was suspended
Check if the stream is suspended; wake up the main loop when it
becomes suspended.
2011-08-23 23:02:13 +02:00
Max Kellermann
3db9ab82ea output/pulse: add assertions 2011-08-23 22:48:22 +02:00
Max Kellermann
2dc3acc5f0 output/pulse: return 0 on error
Not a bool.
2011-08-23 22:48:22 +02:00
Max Kellermann
25686e5bce pulse/output: fix deadlock when resuming the stream
Unlock the mainloop in all code paths.
2011-08-23 22:45:47 +02:00
Max Kellermann
8d70f808d9 input/curl: limit the receive buffer size 2011-08-23 20:46:51 +02:00
Max Kellermann
7c887af1ea output/httpd: add assertions 2011-08-23 18:14:39 +02:00
Max Kellermann
b7f435b50e output/httpd: don't warn on client disconnect
This warning should only be logged when we really received something.
When the client disconnects, G_IO_IN is triggered, and the read
returns G_IO_STATUS_EOF.
2011-08-23 18:02:56 +02:00
Max Kellermann
d3b15f8fda decoder/mpcdec: fix gcc warning
Move the variable "vbr_update_acc" into the #ifdef block.
2011-08-23 17:58:56 +02:00
Jonathan Neuschäfer
eea726740b output/raop: rewrite remove_char_from_string 2011-07-25 11:23:22 +02:00
Max Kellermann
0ea4c970d7 Merge branch 'v0.16.x'
Conflicts:
	src/player_thread.c
	src/playlist_control.c
2011-07-20 21:46:05 +02:00
Max Kellermann
57936a1374 output/raop: use memset() instead of bzero()
There's no bzero() on WIN32.
2011-07-20 21:20:23 +02:00
Max Kellermann
9242fde6b8 output/raop: include winsock.h on WIN32 2011-07-20 21:18:55 +02:00
Max Kellermann
d1f653be65 output/raop: use GMutex instead of pthread_mutex_t
Be portable on WIN32.
2011-07-20 21:11:06 +02:00
Max Kellermann
0035dceb0a output/raop: add missing mutex unlock call in error handler 2011-07-20 21:09:39 +02:00
Max Kellermann
838f7cd210 encoder_plugin: add method pre_tag()
In the "vorbis" plugin, this is a copy of the old flush() method,
while flush() gets a lot of code remove, it just sets the "flush" flag
and nothing else.  It doesn't start a new stream now, which should fix
a few problems in some players.
2011-07-20 20:54:34 +02:00
Max Kellermann
13539961b2 output/httpd: explicitly convert size_t to bool in pause() 2011-07-20 19:16:47 +02:00
Max Kellermann
a26f2ef17d pipe: lock the mutex in music_pipe_size() 2011-07-20 19:05:32 +02:00
Max Kellermann
d97c46bcdc pipe: make read-only functions "pure"
Enable gcc optimizations.
2011-07-20 19:05:26 +02:00
Max Kellermann
2b6542467c output_thread: unlock the mutex while calling cancel()
The method may take longer, and we shouldn't be holding the lock.
2011-07-20 19:05:08 +02:00
Max Kellermann
8fa51faa38 player_thread: lock the player while setting the bite_rate 2011-07-20 19:04:54 +02:00
Max Kellermann
b2175629fd update_walk: apply follow_inside_symlinks to absolute symlinks 2011-07-20 14:15:20 +02:00
Max Kellermann
2e28ed8f81 wavpack: obey all decoder commands, stop at CUE track border
It used to ignore the decoder_data() return value.
2011-07-20 12:54:30 +02:00
Max Kellermann
4c4f8bf02a decoder/wavpack: use the correct integer types
libwavpack provides int32_t samples, and wants uin32_t for sample
counts.
2011-07-20 12:54:22 +02:00
Max Kellermann
e464be5f39 decoder/wavpack: simplify the WavpackUnpackSamples()==0 check
.. and remove one indent level.
2011-07-20 12:32:48 +02:00
Max Kellermann
d7d717f2ce playlist_control: don't resume playback when seeking to another song while paused
Use a shortcut in playlist_seek_song(), don't call
playlist_play_order() because that would reset the "paused" state.
2011-07-20 11:33:51 +02:00
Max Kellermann
d1eeed6a5b output/alsa: fix SIGFPE when alsa announces a period size of 0 2011-07-20 06:54:51 +02:00
Max Kellermann
b159bc0c5f queue: implement song "priorities"
Sorts remaining songs by priority.  This can be used for the
much-demanded "queue feature".
2011-07-19 00:34:33 +02:00
Jonathan Neuschäfer
a222c4879c output/shout: fix a memory leak 2011-07-19 00:24:48 +02:00
Max Kellermann
eb2f413cf0 Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
2011-07-19 00:24:20 +02:00
Max Kellermann
736fd0e293 decoder/ffmpeg: use avformat_open_input() if available
av_open_input_stream() has been deprecated.
2011-07-18 23:31:47 +02:00
Max Kellermann
6592ca9f88 decoder: use AVDictionary instead of AVMetadata
AVMetadata has been deprecated.
2011-07-18 23:31:31 +02:00
Max Kellermann
762712c756 database: require X_OK on parent directory, not R_OK
For accessing the child of a directory, one needs X_OK on the
directory.
2011-07-18 22:48:07 +02:00
Jonathan Neuschäfer
7d6a605a85 output/shout: fix a memory leak 2011-07-18 22:04:48 +02:00
Jonathan Neuschäfer
a6a8bdffc3 output/recorder: fix a memory leak 2011-07-18 22:04:10 +02:00
Jonathan Neuschäfer
296085ff23 output/httpd: add missing g_free in error path 2011-07-18 22:04:06 +02:00
Jonathan Neuschäfer
36aa8ce3c9 output/ao: add missing g_free in error path 2011-07-18 22:03:48 +02:00
Jonathan Neuschäfer
c49c69d6ea conf: add missing fclose in error path
This patch seems a bit ugly, maybe it would be a bit cleaner with gotos.
2011-07-18 22:03:40 +02:00
Jonathan Neuschäfer
d5684f7444 sticker: fix a memory leak 2011-07-18 22:03:37 +02:00
Jonathan Neuschäfer
affb4bd923 ape: add missing g_free in error path 2011-07-18 22:03:34 +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
6aa6a9c272 decoder/flac: validate the sample rate when scanning the tag
Don't calculate the song duration when the sample rate is 0 (division
by zero crash).
2011-07-03 14:57:56 +02:00
oblique
8d1c7ca206 ffmpeg: workaround for semantic API change in recent ffmpeg versions 2011-07-03 14:54:56 +02:00
Max Kellermann
08e2e2e791 fd_util: add function socketpair_cloexec_nonblock() 2011-07-01 10:50:15 +02:00
Max Kellermann
e228caaca6 Merge branch 'v0.16.x'
Conflicts:
	src/decoder/ffmpeg_decoder_plugin.c
2011-06-03 16:58:09 +02:00
Max Kellermann
4b4aa64261 directory: allow directories with just playlists
Keep those when scanning for empty directories.  The check in
playlist_vector_is_empty() was missing.
2011-05-09 21:37:43 +02:00
Qball Cow
9ac8f89b1d cue_tag: show CUE track numbers 2011-05-09 21:26:36 +02:00
Max Kellermann
c6a72a14ac decoder/ffpmeg: don't use av_metadata_conv() in ffmpeg 0.7
It's a no-op and deprecated.
2011-05-09 21:24:18 +02:00
Max Kellermann
c74edd0e33 decoder/ffmpeg: use AVIOContext instead of ByteIOContext 2011-05-09 21:23:58 +02:00
Max Kellermann
98acf3f281 input/ffmpeg: use the new AVIOContext API
URLContext is deprecated.
2011-05-09 21:23:24 +02:00
Max Kellermann
26735390ff playlist_song: fix playlist files in base music directory
g_path_get_dirname() returns "." when there is no directory name in
the given path.  This patch adds a workaround for that.
2011-05-09 18:05:11 +02:00
Max Kellermann
9402b23dd5 playlist_song: fix NULL pointer dereference 2011-05-09 18:03:54 +02:00
Max Kellermann
246db3d565 decoder/ffmpeg: use avcodec_decode_audio3() if available
avcodec_decode_audio3() has been added in libavformat 52.25.0, and the
predecessor avcodec_decode_audio2() has been deprecated.
2011-05-09 09:24:17 +02:00
Max Kellermann
eaf414cbc8 decoder/ffmpeg: make variables more local 2011-05-09 09:24:15 +02:00
Anton Khirnov
327d41c00f decoder/ffmpeg: don't use deprecated CODEC_TYPE_AUDIO with new lavc
fixes build with lavc 53.
2011-05-09 08:00:45 +02:00
Max Kellermann
05d8ce3bcd decoder/ffmpeg: define fallback macro AV_VERSION_INT()
For ffmpeg < 0.5.  Copied from libavutil 0.5.
2011-05-09 08:00:45 +02:00
Max Kellermann
fe30db935b decoder/ffmpeg: use avcodec_decode_audio3() if available
avcodec_decode_audio3() has been added in libavformat 52.25.0, and the
predecessor avcodec_decode_audio2() has been deprecated.
2011-04-12 08:20:35 +02:00
Max Kellermann
6303d54cbb decoder/ffmpeg: make variables more local 2011-04-12 08:17:30 +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
Max Kellermann
c2ada39fd3 Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
2011-04-12 08:11:33 +02:00
Max Kellermann
def2fe8805 Merge branch 'v0.15.x' into v0.16.x
Conflicts:
	NEWS
	configure.ac
	src/listen.c
2011-04-12 07:39:01 +02:00
Simon Kagstrom
77b6e27500 playlist: Despotify plugin: Correct init in daemon mode
There is a global despotify session, so it should not be initialized
until needed.
2011-04-12 07:28:00 +02:00
Jonathan Neuschäfer
6d3ed3f16f fix common misspellings
These fixes were mostly generated with `codespell' [0] and manually
reviewed.

[0] http://git.profusion.mobi/cgit.cgi/lucas/codespell/
2011-03-31 21:46:01 +02:00
Simon Kagstrom
a25743875f playlist: Add despotify playlist plugin
For spotify playlists or tracks. Uses a spt uri, so with mpc you can
add playlists with

  mpc load spt://spotify:user:simon.kagstrom:playlist:3SUwkOe5VbVHysZcidEZtH
2011-03-29 17:01:16 +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
Simon Kagstrom
eec77b3ae7 despotify: Add support utilities
Used to connect and authenticate to despotify. Provides a singleton
session and a desptoify-track-to-tags function.
2011-03-29 17:01:16 +02:00
Max Kellermann
f680b0a431 decoder/flac: fix enum mismatch in flac_tell_cb()
Fix clang warning.
2011-03-23 22:31:40 +01:00
Max Kellermann
d4b00ff11c listen: suppress "unused variable" warning 2011-03-23 22:27:31 +01:00
Max Kellermann
532f94a187 audio_parser: fix assertion failure in audio format mask parser
Use audio_format_mask_valid() to verify a mask.
2011-03-23 22:22:51 +01:00
Max Kellermann
87ad2f8542 command: fix return value of handle_currentsong()
Thanks to clang for complaining.
2011-03-23 22:16:46 +01:00
Simon Kagstrom
640bac1aa4 decoder: PCM decoder: Inherit seekable from the input stream
E.g., spotify isn't seekable.
2011-03-23 22:13:11 +01:00
Simon Kagstrom
0b12fae84d decoder: PCM decoder: Break loop if EOF is encountered
Otherwise the song playing might go on forever.
2011-03-23 22:13:08 +01:00
Hans-Kristian Arntzen
d9353c4fd3 Remove unused headers in Roar plugin.
Should fix build errors for Win32.
2011-03-23 21:59:22 +01:00
Max Kellermann
0c9fc2f809 Merge commit 'release-0.16.2'
Conflicts:
	Makefile.am
	NEWS
	configure.ac
2011-03-19 09:58:07 +01:00
Max Kellermann
1fc571088b command: print playlist load error
Call print_playlist_result() instead of casting the enum implicitly.
2011-03-18 19:45:59 +01:00
Max Kellermann
8d83914f05 output/httpd: include sys/socket.h only when building with libwrap
Fixes build failure on WIN32.
2011-03-18 19:44:12 +01:00
Max Kellermann
0fdcd381bc update_walk: ignore parameter "mode" on WIN32
Fix compiler warning.
2011-03-18 19:43:26 +01:00
Max Kellermann
4f293ecd6f audio_format, output_thread: add more audio_format_valid() assertions 2011-03-16 23:37:41 +01:00
Max Kellermann
b6303313f0 encoder/vorbis: reset the Ogg stream after flush
Without the ogg_stream_reset() call, the "e_o_s" flag never gets
reset, and libogg writes EOS packets over and over.
2011-03-16 19:16:06 +01:00
Max Kellermann
a28449a123 encoder/vorbis: reset the Ogg stream after flush
Without the ogg_stream_reset() call, the "e_o_s" flag never gets
reset, and libogg writes EOS packets over and over.
2011-03-16 19:13:46 +01:00
Max Kellermann
6dcec36621 Merge release 0.15.16 into v0.16.x
Conflicts:
	NEWS
	configure.ac
	src/output/jack_plugin.c
	src/update.c
2011-03-16 18:08:54 +01:00
Hans-Kristian Arntzen
1a954748a0 RoarAudio output plugin 2011-03-16 17:57:47 +01:00
Ulrich Spörlein
e2aea6bce5 output/httpd: include sys/socket.h for AF_UNIX 2011-03-09 19:53:48 +01:00
Max Kellermann
a1d1c2beaa output/oss: disable 24 bit playback on FreeBSD
See code comment.
2011-02-28 00:09:45 +01:00
Max Kellermann
ee9c60fad4 output/oss: AFMT_S24_PACKED is little-endian
According to the Solaris dsp manpage, AFMT_S24_PACKED is
little-endian:

 http://download.oracle.com/docs/cd/E19963-01/821-1475/6nmf5baot/index.html

The Minix soundcard.h header says the same.
2011-02-28 00:00:41 +01:00
Max Kellermann
2abad0f479 command: "update" and "rescan" need only "CONTROL" permission
From http://bugs.debian.org/513291

 "In mpd.conf, the "admin" permission covers updating the db and
 killing mpd.

 "Since there are quite some usecases in which the user can upload
 music to the mpd's directory by means of anonymous FTP or so, it is
 desirable that any user may issue a db update, while killing the mpd
 should not be possible.

 "I'd suggest to remove the db update from the admin group and either
 add it to "control" or an own group."
2011-02-27 23:35:00 +01:00
Max Kellermann
1674a4ec82 output/jack: fix crash with mono playback
With mono sound, jack_sample_size is smaller than frame_size (4 vs 2
bytes), and "space/jack_sample_size==0".  That means mpd_jack_play()
will return 0, although no error has occurred.
2011-02-27 23:26:50 +01:00
Max Kellermann
ce370bee60 output/jack: rename variable sample_size to jack_sample_size 2011-02-25 10:46:44 +01:00
Max Kellermann
2fb40fe728 playlist_state: add option "restore_paused"
When set, MPD will not auto-start playback on startup; it will be in
"paused" state.
2011-02-23 09:10:23 +01:00
Max Kellermann
b57330cf75 playlist_state: declare local variable as enum 2011-02-23 09:10:23 +01:00
Christopher Brannon
2a1f4539f6 Insure proper initialization of stack-allocated struct.
Version 1.0.0 of the libao library added a new field to the
ao_sample_format struct.  It is a char * named matrix.  When
an ao_sample_format is allocated on the stack, this field contains
garbage.  The proper course is to insure that is initialized to NULL.
NULL indicates that we do not want any mapping.
The struct is now initialized using a static initializer, and this
technique is compatible with all known versions of libao.
2011-02-15 12:16:25 +01:00
Thomas Jansen
144d092637 output/shout: add possibility to set url
Added a new optional parameter for the shout plugin called "url".
2011-02-09 22:42:51 +01:00
Thomas Jansen
948b8f35e6 general: whitespace cleanup
Remove trailing whitespace found by this command:
find -name '*.[ch]' | xargs grep "[[:space:]]$"
2011-02-09 22:42:31 +01:00
Thomas Jansen
e776c605ad output/httpd: initialize unflushed_input
This fixes the following valgrind warning occuring on the first call of
httpd_output_read_page:
==20124== Conditional jump or move depends on uninitialised value(s)
==20124==    at 0x425E65: httpd_output_read_page (httpd_output_plugin.c:240)
==20124==    by 0x426087: httpd_output_open (httpd_output_plugin.c:279)
==20124==    by 0x41D862: ao_open (output_plugin.h:206)
==20124==    by 0x41E133: audio_output_task (output_thread.c:590)
2011-02-09 22:41:36 +01:00
Tony Miller
8b2f4fc823 Set fadeout in gme_decoder_plugin. Due to the nature of the gme library,
this needs to be done for the end of songs to be detected.
2011-02-03 00:25:35 +01:00
Max Kellermann
03018611f8 update: log all file permission problems 2011-01-31 09:39:24 +01:00
Max Kellermann
f8b09c194f protocol: support client-to-client communication 2011-01-29 10:43:54 +01:00
Max Kellermann
0e69ad32c1 client_idle: export client_idle_add() 2011-01-29 10:43:54 +01:00
Max Kellermann
9b4e14df71 client_idle: add header client_idle.h 2011-01-29 10:43:54 +01: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
Dustin Puckett
79e0db4ca0 output/raop: new output plugin
Remote Audio Output Protocol (RAOP), for Apple devices.
2011-01-28 21:17:09 +01:00
Yuriy Kaminskiy
9ae3acf2e7 mpg123 decoder: implement seeking 2011-01-21 15:37:08 +01:00
Yuriy Kaminskiy
731ea9b489 mpg123 decoder: report bitrate 2011-01-21 15:37:08 +01:00
Max Kellermann
18b30b5019 decoder_thread: fix assertion failure at song end
Don't finish the current command twice.

This bug was never noticed, but was revealed by a new assertion check.
2011-01-16 17:52:03 +01:00
Andreas Wiese
e6c3acaa6f Fix NDEBUG test
<stdbool.h> needs to be included unconditionally from definition of
NDEBUG, since »bool« doesn't get defined otherwise.

Signed-off-by: Andreas Wiese <aw-devel@meterriblecrew.net>
2011-01-14 16:22:25 +01:00
Max Kellermann
a1edc199df output_control: document internal functions 2011-01-10 22:16:44 +01:00
Max Kellermann
db4aa81528 output_control: move code to ao_lock_command() 2011-01-10 21:54:43 +01:00
Max Kellermann
319ba94a52 output_control: ao_command() calls ao_command_async()
Merge some code.
2011-01-10 21:52:38 +01:00
Max Kellermann
1025f0be91 update_remove: use plain GCond instead of notify
GMutex/GCond guarantee that the access to removed_song is protected.
2011-01-10 21:40:15 +01:00
Max Kellermann
77d3b5e8f1 include cleanup 2011-01-10 21:38:11 +01:00
Max Kellermann
a0ad96a787 decoder_control: store GCond object, not a player_control
Remove the decoder dependency on player_control.  All player_control
was needed for is to signal the player thread, and we can do that with
a simple GCond as well.
2011-01-10 21:27:43 +01:00
Max Kellermann
39c5af5dbc decoder_thread: move code to decoder_command_finished_locked() 2011-01-10 21:08:16 +01:00
Max Kellermann
acca6a799b decoder_control: remove unused function dc_command_wait()
Only dc_command_wait_locked() is really being used.
2011-01-10 21:08:16 +01:00
Max Kellermann
b77e62260a decoder_control: replace dc_init() with dc_new()
dc_new() allocates the object and returns it.  dc_free() frees it
(replaces dc_deinit()).
2011-01-10 20:46:04 +01:00
Max Kellermann
b6995ca011 player_control: removed the global variable "pc"
Allocate a player_control object where needed, and pass it around.
Each "client" object is associated with a "player_control" instance.

This prepares multi-player support.
2011-01-10 19:46:23 +01:00
Max Kellermann
715844fd08 dbUtils: don't use directoryAddSongToPlaylist() twice
In findAddInDirectory(), call playlist_append_song() directly, to have
some more type checking.
2011-01-10 19:46:14 +01:00
Max Kellermann
5184008812 input_init: add assertions on completeness of plugins 2011-01-08 18:27:57 +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
1a2ea4c06c Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
2011-01-07 23:52:23 +01:00
Max Kellermann
8c0afd8557 Merge branch 'v0.15.x' into v0.16.x
Conflicts:
	NEWS
	configure.ac
	src/directory.h
2011-01-07 23:50:23 +01:00
Max Kellermann
2a56300f7b player_thread: discard empty chunks while cross-fading
When a music_chunk to be crossfaded consists only of a tag,
cross-fading is not possible, and led to an assertion failure.  This
patch just discards those, as if cross-fading was not enabled.
2011-01-07 23:45:51 +01:00
Max Kellermann
5f06999686 output_thread: fix double lock
During the whole output thread, the audio_output object is locked, and
it is only unlocked while waiting for the GCond and while running a
plugin method.  The error handler in ao_play_chunk() attempted to lock
the object again, which was code from MPD 0.15.x which should have
been removed a long time ago.
2011-01-07 23:08:18 +01:00
Max Kellermann
4c09aeb5a1 player_thread: fix assertion failure due to early seek
Until the decoder plugin has called decoder_initialized(), the player
may not submit seek commands.  This however could occur with a slow
decoder and a CUE file with a virtual song offset.  This patch adds
another check.
2011-01-07 22:52:50 +01:00
Max Kellermann
af892e7e80 player_thread: make variables more local 2011-01-07 22:33:10 +01:00
Max Kellermann
0022fb100b encoder/lame: explicitly configure the output sample rate
When you don't explicitly set an output sample rate, liblame tries to
guess an output sample rate from the input sample rate.  You would
think that this "guessing" consists of just setting both equal, but
that is not the case.  For 44.1kHz at 96kbit/s, liblame chooses
32kHz.  This patch explicitly configures the output sample rate, to
stop the bad guessing.
2011-01-07 19:37:39 +01:00
Max Kellermann
4f2d67dfb0 output/httpd: define G_LOG_DOMAIN in httpd_client.c 2011-01-07 18:00:12 +01:00
Max Kellermann
b5645ab29f output/osx: fix up audio format first, then apply it to device
This is a MPD 0.16 regression: when playing a 24 bit file, the switch
to 16 bit was made only partially, after mBytesPerPacket and
mBytesPerFrame had already been applied.

That means mBytesPerFrame referred to 24 bit, and mBitsPerChannel
referred to 16 bits.  Of course, that cannot work.
2011-01-07 17:31:36 +01:00
Ben Kibbey
ff4534613a Build fix for Linux. Define _GNU_SOURCE in src/server_socket.c. 2010-12-27 04:36:23 +01:00
Max Kellermann
be3b5199b0 stored_playlist: remove database lookups from spl_load()
Don't look up songs in the database, no caller needs this.
2010-12-23 16:25:37 +01:00
Max Kellermann
d849a40af6 stored_playlist: ignore empty lines 2010-12-23 16:25:22 +01:00
Max Kellermann
4f48c10312 stored_playlist: use the text_file library to read lines 2010-12-23 16:25:05 +01:00
Max Kellermann
5274fee8a7 playlist_song: add flag "secure"
Optionally allow all local files.

"Insecure" mode is used for printing playlists.
2010-12-23 16:24:00 +01:00
Max Kellermann
5462f34ed0 string_util: add function strchug_fast()
Replace g_strchug() calls with a cheaper implementation.
2010-12-23 16:23:20 +01:00
Max Kellermann
0958ed5844 utils: move string_array_contains() to string_util.c 2010-12-23 16:23:04 +01:00
Max Kellermann
e3cba18532 decoder: new "pcm" decoder plugin
Just there to support the "cdio_paranoia" input plugin.
2010-12-22 09:48:48 +01:00
Max Kellermann
9bf7fde49f configure.ac: hook the cdio_paranoia input plugin 2010-12-22 09:44:02 +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
60b4f6b3eb directory: fix warning "comparison between signed and unsigned"
Cast the constant to dev_t, not to unsigned.
2010-12-21 20:21:22 +01:00
Max Kellermann
546232b1c0 zeroconf-bonjour: use g_htons() instead of htons()
Fixes the gcc warning "implicit declaration of function 'htons'".
2010-12-21 20:21:20 +01:00
Max Kellermann
fb00e7fddc add void casts to suppress "result unused" warnings (clang) 2010-12-21 08:06:02 +01:00
Alex Viskovatoff
41fdcf328c decoder/mad: work around build failure on Solaris
Rename the "version" struct, because it seems to be a reserved name on
Solaris:

 "src/decoder/mad_decoder_plugin.c", line 550: (enum) tag redeclared: version
 cc: acomp failed for src/decoder/mad_decoder_plugin.c
2010-12-21 07:57:07 +01:00
Greg Ward
9cb4aaf3c2 osx_output: always pass OS X result code to g_set_error().
Should be safe on OS X 10.4 (32-bit), since Apple's OSStatus boils
down to "signed long", and g_set_error() takes gint, which is really
just "int".  Assigning "signed long" to "int" on 32-bit Unix should be
just fine, since both are signed 32-bit ints.

No idea if this is safe on 64-bit OS X.
2010-12-21 07:37:54 +01:00
Greg Ward
80dc602193 osx_output: allow user to specify other audio devices.
Add new config parameter 'device' to audio_output type "osx":
- if not supplied or set to "default", open default device
- if set to "system", open system device
- otherwise 'device' should be an audio device name: mpd will find and
  open the specified audio device, falling back to the default
  device if it's not found
2010-12-21 07:36:28 +01:00
Alex Viskovatoff
144ad7992e output/solaris: add missing parameter to open_cloexec() call 2010-12-21 07:31:08 +01:00
Alex Viskovatoff
a0dd1a1b8b audio_check: fix parameter in prototype 2010-12-21 07:29:58 +01:00
Max Kellermann
748a8a6f42 tag_id3: support multiple values
Loop over all frames with a specific id, and import all of them - not
just the first one (index 0).
2010-12-07 18:05:44 +01:00
Anton Khirnov
cb9965bab5 command: don't error when sticker list is run on song with no stickers
this is inconsistent with other commands (e.g. find) and seems wrong --
a song with no stickers attached is a perfectly valid state and an empty
list of stickers is also perfectly valid.
2010-12-07 17:32:52 +01:00
Max Kellermann
429ed24c99 tag_ape: support multiple values
One APE tag may contain more than one value, separated by null bytes.
2010-11-24 08:59:04 +01:00
Max Kellermann
1ab46472ab decoder_thread: load APE replay gain from music files 2010-11-18 23:02:30 +01:00
Max Kellermann
f6bbe1332f replay_gain_ape: parse replay gain from APE tags
Based on the APE reader.
2010-11-18 22:26:06 +01:00
Max Kellermann
11613347be tag_ape: move code to ape.c
Generic library for scanning APE tags.  Eliminated one "goto"!
2010-11-18 21:44:24 +01:00
Max Kellermann
8f46f1520c timer: fix integer overflow in timer_delay()
Fixes a regression: for output_plugin.delay(), we added a method to
the timer class which returns the delay in milliseconds.  This fails
to detect negative values, because the unsigned integer is divided by
1000, and then casted to signed.
2010-11-18 21:29:03 +01:00
Max Kellermann
46ab8d18e2 playlist_song: calculate duration of last CUE track 2010-11-08 20:16:26 +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
cc1debc948 output/shout: artist comes first in stream title
After popular demand, I've switched the order of "artist" and "title"
in the stream title.  There is no standard, and there is no reliable
way to parse those from the stream title.
2010-11-08 18:46:14 +01:00
Max Kellermann
5a3aa1262a update_walk: explicitly check for permission problems
Call access() and print an extra error message when EACCES is
returned.  Hopefully this will reduce the number of support requests
due to wrong file permissions.
2010-11-08 18:24:19 +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
83ec0e5552 player_thread: fix assertion failure due to wrong music pipe on seek
When one song is played twice, and the decoder is working on the
second "instance", but the first should be seeked, the check in
player_seek_decoder() may assume that it can reuse the decoder without
exchanging pipes.  The last thing was the mistake: the pipe pointer
was different, which led to an assertion failure.  This patch adds
another check which exchanges the player pipe.
2010-11-05 19:24:42 +01:00
Max Kellermann
cc261872c2 decoder_control: pass music_pipe to dc_start()
More abstraction for decoder_control.pipe.
2010-11-05 19:18:44 +01:00
Max Kellermann
5223261f19 player_thread: add helper function player_dc_at_next_song()
Some abstraction for decoder_control.pipe access.
2010-11-05 19:08:59 +01:00
Max Kellermann
c594afeee7 pipe: add helper function music_pipe_empty() 2010-11-05 18:40:23 +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