Commit Graph

4483 Commits

Author SHA1 Message Date
Anton Khirnov
c3569814bd ffmpeg: read more metadata. 2010-06-30 23:18:45 +02:00
Max Kellermann
814daac5ba decoder/ffmpeg: free AVFormatContext on error
Fix a memory leak in some code paths.
2010-06-30 23:14:43 +02:00
Max Kellermann
768be22f7c pcm_buffer: make the buffer pointer "void" 2010-06-30 21:55:46 +02:00
Max Kellermann
ec89ce5a8a decoder/mp4ff: support tag "album artist"
We already supported "albumartist", but it seems some folks also use
"album artist" (with a space).
2010-06-30 21:55:03 +02:00
Andreas Vögele
34415bf0b6 Make get_remote_uid() work on BSD
I've attached a patch that will make file URIs work on operating systems
that provide the getpeereid() function call to check the user ID of the
peer connected to a UNIX domain socket.
2010-06-30 21:42:01 +02:00
Max Kellermann
0a0c78674f playlist: emit IDLE_OPTIONS when resetting single mode 2010-06-30 21:40:33 +02:00
Max Kellermann
1bffdabe41 directory_print: return void
There is no useful return value here.
2010-06-30 21:39:34 +02:00
Max Kellermann
77e6810c14 decoder/mikmod: fix memory leak
The return value of Player_LoadTitle() is allocated with malloc(), and
must be freed by the caller.
2010-06-30 19:37:36 +00:00
Max Kellermann
5ebe33653c decoder/mp4ff: remove duplicate entries in the tag name table
Reuse the function tag_name_parse_i().
2010-06-30 21:36:15 +02:00
Max Kellermann
8e3eace289 decoder/mp4ff: moved code to mp4ff_tag_name_parse() 2010-06-30 21:36:00 +02:00
Max Kellermann
284659034d tag_ape: remove duplicate entries in the tag name table
Reuse the function tag_name_parse_i().
2010-06-30 21:33:19 +02:00
Max Kellermann
9550c87327 tag: added function tag_name_parse()
Convert a string into a tag_type enum.
2010-06-30 21:31:45 +02:00
Max Kellermann
e223e8a5b5 tag_ape: move code to tag_ape_name_parse() 2010-06-30 21:30:21 +02:00
Max Kellermann
4d6d372a5b decoder/vorbis: use single global ov_callbacks constant
Initialize the ov_callbacks struct at compile time.
2010-06-30 19:24:41 +00:00
Max Kellermann
0aeec90590 decoder/mp4ff: support tags "albumartist", "band"
I'm not sure if mapping "band" to TAG_PERFORMER is correct, but it
might be better than nothing.
2010-06-30 21:22:13 +02:00
Max Kellermann
cfcd84655c decoder/mp4ff: use tag_table.h to parse tag names
Convert if/else/else/... to a loop.
2010-06-30 21:19:30 +02:00
Max Kellermann
5092eaf1cc tag_ape: move table lookup to tag_table.h
Allow code sharing.
2010-06-30 21:18:27 +02:00
Max Kellermann
9328558fc7 tag_ape: support album artist
I took this tag name from a MusePack sample file I got from a user.
It is not documented in the APE specification:

 http://wiki.hydrogenaudio.org/index.php?title=APE_key

People seem to be using undocumented extensions to the specification
anyway, and the best we can do is attempt to support them.
2010-06-30 21:16:28 +02:00
Max Kellermann
026bd15872 tag_ape: simplified the apeItems array
Make "enum tag_type" the array index, and convert apeItems to a sparse
array.
2010-06-30 21:15:52 +02:00
Max Kellermann
7cca55549b tag_ape: moved code to tag_ape_import_item()
Improve code readability.
2010-06-30 21:15:39 +02:00
Max Kellermann
c7e89ea3a3 tag_ape: converted apeItems and tagItems to global vars
Don't initialize those arrays each time tag_ape_load() is called.
2010-06-30 21:15:14 +02:00
Max Kellermann
5a2820ca3d pcm_buffer: make the buffer pointer "void" 2010-06-30 08:21:48 +02:00
Max Kellermann
9eb292c1e5 decoder/mp4ff: support tag "album artist"
We already supported "albumartist", but it seems some folks also use
"album artist" (with a space).
2010-06-25 22:54:18 +02:00
Max Kellermann
5216cfb3c8 playlist_print: use playlist_open_any()
Allow printing remote playlists with the commands "listplaylist" and
"listplaylistinfo".
2010-06-25 22:43:52 +02:00
Max Kellermann
373d1843a8 playlist_queue: use playlist_open_any() 2010-06-25 22:43:52 +02:00
Max Kellermann
82ee278f53 playlist_any: new library to simplify opening playlist files
The new function playlist_open_any() combines playlist_mapper_open(),
playlist_list_open_uri() and playlist_list_open_stream(), providing an
easy API for all of them.
2010-06-25 22:43:52 +02:00
Max Kellermann
c27fc26ecd playlist_list: probe plugin without MIME attributes
If the MIME type of a stream contains a semicolon, remove it and the
text after it to probe for a playlist plugin.
2010-06-25 22:43:52 +02:00
Max Kellermann
fba13bd5d2 playlist_queue: simplify error handler
Return early on error, save one level of indent.
2010-06-25 22:37:34 +02:00
Max Kellermann
68f75955d8 playlist_list: moved input_stream.ready loop to calling function
Merged both loops into playlist_list_open_stream().  This is needed
because playlist_list_open_stream() needs to know the MIME type, which
is only known after the stream has become "ready".
2010-06-25 22:37:34 +02:00
Max Kellermann
cd21cfc115 uri: really count dots in verify_uri_segment()
This buggy implementation failed to allow "..." sequences, because the
dot count was always zero.  The usefulness of allowing "..." (or more
dots) is debatable, but since it's a valid file name, we allow it.
2010-06-25 21:56:12 +02:00
Max Kellermann
1ea10db953 playlist/cue: last track ends at end of file
libcue's track_get_length() returns 0 for the last track, because that
information is not available in the CUE sheet.  This makes MPD quit
playing the last track immediately.  If we set "song.end_ms=0", MPD
will play the track until the end of the song file, which is what we
want.
2010-06-25 20:02:55 +02:00
Max Kellermann
6bb7a7439d song_print: simplified start_ms/end_ms check 2010-06-25 20:02:55 +02:00
Aaron Griffith
ca6110d92f playlist_list: wait for input stream to become ready
Fixes an assertion failure in the input_stream_seek() call.
2010-06-25 19:20:20 +02:00
Andreas Vögele
dda5415def Make get_remote_uid() work on BSD
I've attached a patch that will make file URIs work on operating systems
that provide the getpeereid() function call to check the user ID of the
peer connected to a UNIX domain socket.
2010-06-19 13:47:10 +02:00
Andrzej Rybczak
4347114455 client: increase send_buf from 4kB to 16kB
this greatly improves performance of commands that return a lot
of data, e.g. search results or recursive content of a directory,
while being connected to local mpd via tcp/ip socket.
2010-06-19 13:45:54 +02:00
Max Kellermann
9fb26b5617 playlist: check "queued" before calling playlist_update_queued_song()
Workaround for an assertion failure.
2010-06-19 13:45:15 +02:00
Max Kellermann
442b327582 playlist: protect acess to player state in playlist_sync() 2010-06-19 13:33:39 +02:00
Max Kellermann
cff727644d playlist: move checks out of playlist_sync_with_queue()
Rename the function to playlist_song_started(), which gets only called
if the song has actually started.
2010-06-19 13:33:32 +02:00
Max Kellermann
7f80349494 player_control: hold mutex in pc_play(), pc_pause()
Race condition fix.
2010-06-19 13:19:30 +02:00
Max Kellermann
d0d2d6ed1b filter/route: fixed unsigned/signed comparison
Fixes a clang warning.
2010-06-06 21:56:30 +02:00
Tim Phipps
4e83b79d2b output/httpd: add libwrap support
libwrap support is in MPD but only for the control port.  This patch
adds support for the http port.  The code is copied from
src/client_new.c
2010-06-06 21:53:24 +02:00
Max Kellermann
37e69a89b9 directory_print: print a list of playlist files in "lsinfo"
Print those files which can be handled by a playlist plugin.
2010-06-01 10:00:01 +02:00
Max Kellermann
6f28eb4c0a playlist_list: export playlist_suffix_supported() 2010-06-01 09:59:56 +02:00
Max Kellermann
caf93d9a2c playlist_list: playlist_list_open_path() returns input_stream
Memory leak fix.  The input_stream object passed to
playlist_list_open_stream_suffix() must be closed by the caller - this
however never happens in playlist_list_open_path(), because it does
not return it to the caller.
2010-06-01 09:59:54 +02:00
Max Kellermann
747e945d29 playlist_list: move fallback g_uri_parse_scheme() to glib_compat.h 2010-06-01 09:59:52 +02:00
Max Kellermann
067d7212bf playlist: emit IDLE_OPTIONS when resetting single mode 2010-06-01 09:59:46 +02:00
Romain Bignon
867b93a5b2 single mode: at the end of the song, pause on the next song instead of stop 2010-05-31 23:36:16 +02:00
Max Kellermann
53647c8ba1 directory_print: return void
There is no useful return value here.
2010-05-31 22:16:03 +02:00
Romain Bignon
b571ba27a4 fix crash when decoder is NULL 2010-05-31 22:11:59 +02:00
Max Kellermann
de8f2739c2 decoder/mikmod: fix memory leak
The return value of Player_LoadTitle() is allocated with malloc(), and
must be freed by the caller.
2010-05-31 10:24:08 +02:00
Max Kellermann
2c1c588868 decoder/mikmod: duplicate the path only once 2010-05-31 10:22:08 +02:00
Max Kellermann
e271f69a34 decoder/mikdmod: moved local variable declarations in tag_dup() 2010-05-31 10:16:09 +02:00
Max Kellermann
39105f2119 decoder/wildmidi: moved local variable declarations in tag_dup() 2010-05-31 10:14:48 +02:00
Max Kellermann
4e080a9b06 decoder/gme: replace macro GME_BUF_SIZE
Added macros with better names: GME_BUFFER_FRAMES, GME_BUFFER_SAMPLES
(the former only used to calculate the latter).
2010-05-31 10:03:43 +02:00
Max Kellermann
d55740808d decoder/gme: added constants for sample rate and channels
Move into enums.
2010-05-31 10:02:43 +02:00
Max Kellermann
6566038df9 decoder/gme: pass the whole buffer to decoder_data()
Pass sizeof(buf) to decoder_data(), not the number of samples (which
is half the size).  At the same time, pass GME_BUF_SIZE to gme_play()
- libgme really wants to get the number of samples, not the number of
stereo frames.  Previously, this plugin had been using only the first
half of the buffer.
2010-05-31 09:57:15 +02:00
Max Kellermann
f0faf00320 decoder/gme: allocate tag later, fixes memory leak
Allocate the "tag" object after the file has been opened successfully.
2010-05-31 09:43:25 +02:00
Max Kellermann
51c7577c8f decoder/mp4ff: rename and move local variable
Allocate the "tag" object after the file has been checked.  That
removes one tag_free() call in an error handler.
2010-05-31 09:35:49 +02:00
Max Kellermann
be308c6657 decoder/mp4ff: merge code into mp4ff_input_stream_open() 2010-05-31 09:29:45 +02:00
Max Kellermann
1729a0b437 decoder/mp4ff: move mp4ff_callback_t into mp4ff_input_stream
Allocate only one item on the stack.
2010-05-31 09:23:27 +02:00
Max Kellermann
1b2fc2ae19 decoder/mp4ff: rename mp4_context to mp4ff_input_stream 2010-05-31 09:22:42 +02:00
Max Kellermann
58a75f0b78 decoder/mp4ff: remove duplicate entries in the tag name table
Reuse the function tag_name_parse_i().
2010-05-31 08:48:41 +02:00
Max Kellermann
daf6e2b5da decoder/mp4ff: moved code to mp4ff_tag_name_parse() 2010-05-31 08:47:59 +02:00
Max Kellermann
71da5b026c tag_ape: remove duplicate entries in the tag name table
Reuse the function tag_name_parse_i().
2010-05-31 08:24:05 +02:00
Max Kellermann
2f68ea635b tag_ape: move code to tag_ape_name_parse() 2010-05-31 08:22:53 +02:00
Max Kellermann
ca08c4dbf4 decoder/vorbis: rename local variable "ret" 2010-05-31 00:06:37 +02:00
Max Kellermann
8af52fa205 decoder/vorbis: implement method stream_tag()
This allows tags in archive files.
2010-05-31 00:02:57 +02:00
Max Kellermann
3b0bf856c4 decoder/vorbis: move code to vorbis_open_stream() 2010-05-31 00:00:04 +02:00
Max Kellermann
28f5803d34 decoder/vorbis: use single global ov_callbacks constant
Initialize the ov_callbacks struct at compile time.
2010-05-30 23:59:36 +02:00
Max Kellermann
0b72299857 decoder/vorbis: rename struct vorbis_decoder_data to vorbis_is 2010-05-30 23:57:58 +02:00
Max Kellermann
4a2302c2ed inotify_update: follow symlinks
This is probably unsafe, and doesn't protect against symlink loops,
but we will eventually add this when we bring update*.c and inotify*.c
closer together.
2010-05-30 23:45:47 +02:00
Max Kellermann
980201a665 inotify_update: fix assertion failure when music dir is deleted
This shouldn't really happen, but insane users might delete/rename the
music directory while MPD runs.  What was even more insane was that
MPD crashed due to this.  This is a workaround - there is currently
nothing useful we can do in this case; except maybe poll for the music
directory to reappear, but that's too much trouble for a user error.
2010-05-30 23:45:46 +02:00
Max Kellermann
017d61a1aa decoder/mp4ff: support tags "albumartist", "band"
I'm not sure if mapping "band" to TAG_PERFORMER is correct, but it
might be better than nothing.
2010-05-30 22:55:02 +02:00
Max Kellermann
4028d03a6e decoder/mp4ff: use tag_table.h to parse tag names
Convert if/else/else/... to a loop.
2010-05-30 22:52:45 +02:00
Max Kellermann
44b771aca1 decoder/mp4ff: rename plugin "mp4" to "mp4ff"
The underlying library is named "libmp4ff".  To reduce confusion,
rename the plugin to a more specific name.
2010-05-30 22:52:44 +02:00
Max Kellermann
8c581eca4d tag_ape: move table lookup to tag_table.h
Allow code sharing.
2010-05-30 22:52:19 +02:00
Max Kellermann
8e815bec9f tag_ape: support album artist, MusicBrainz tags
I took these tag names from a MusePack sample file I got from a user.
These are not documented in the APE specification:

 http://wiki.hydrogenaudio.org/index.php?title=APE_key

People seem to be using undocumented extensions to the specification
anyway, and the best we can do is attempt to support them.
2010-05-30 22:29:48 +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
442d2e74e3 decoder/mad: fix buffer variable name on !HAVE_ID3TAG 2010-05-30 17:27:03 +02:00
Daniel Seuthe
e8310211e2 filter/replay_gain: added option "replaygain_limit" 2010-05-30 17:06:08 +02:00
Avuton Olrich
894573657d cmdline: Add default config paths for win32. 2010-05-20 06:56:43 -07:00
Max Kellermann
9cce1d749a output/win32: new output plugin for Windows Wave 2010-05-20 09:33:05 +02:00
Max Kellermann
ed0b48040c pcm_buffer: 8 kB alignment instead of 64 kB
Reduce the overhead.  Most buffers used by MPD are around 2 to 4 kB.
8 kB seems large enough to keep heap fragmentation low.

Additionally, this patch fixes an off-by-one error in the alignment
formula.
2010-05-20 09:31:51 +02:00
Max Kellermann
eda46bc07f tag_{id3,ape}: explicitly open files in binary mode
Add the flag "b" to fopen().  Windows compatibility.
2010-05-20 09:14:11 +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
57b4013306 client: use sprintf() on WIN32
On mingw32, snprintf() expects a 64 bit integer instead of a "long
int" for "%li" - this is not consistent with our expectation, so we're
using plain sprintf().
2010-05-19 13:12:37 +02:00
Max Kellermann
8248f498b2 event_pipe: use g_io_channel_read_chars() to drain the pipe
For some unknown reason, read() blocks on WIN32, even though it was
invoked inside the G_IO_IN callback.  By switching to GIOChannel
functions, this problem is solved, and it works on both Linux and
Windows.
2010-05-19 11:37:39 +02:00
Max Kellermann
22f3ffb099 event_pipe: call g_io_channel_win32_new_fd()
On WIN32, use g_io_channel_win32_new_fd() instead of
g_io_channel_unix_new().  There doesn't seem to be a practical
difference, but it seems more correct.
2010-05-19 11:37:22 +02:00
Max Kellermann
81bd8ef73c update_walk: don't check recursive symlinks on WIN32
inode numbers don't work on WIN32, and very few WIN32 users actually
use symlinks - seems ok to disable that check.
2010-05-19 11:36:07 +02:00
Max Kellermann
bedc172eab crossfade: emulate strtok_r() on WIN32 with a function
Not a CPP macro.  This adds the "unused" attribute to "saveptr", which
eliminates one gcc warning.
2010-05-18 23:56:53 +02:00
Max Kellermann
0a9b0dd070 command: fallback strftime() formats on WIN32
On WIN32, "%F" and "%T" are not implemented.
2010-05-18 23:54:12 +02:00
Max Kellermann
6aa0f61e15 socket_util: fix setsockopt() argument type on WIN32
In the winsock headers, the setsockopt() argument is declared as
"const char *", not "const void *".
2010-05-18 23:13:05 +02:00
Max Kellermann
4461c3d5d1 daemon: include glib.h on WIN32 for g_error() 2010-05-18 23:13:05 +02:00
Max Kellermann
fef46bcf49 fd_util: fd_set_cloexec() returns a value on WIN32
This function is empty on WIN32, but we need to return a value.
2010-05-18 23:09:07 +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
Daniel Seuthe
733962db2f decoder_api: return effective replay gain
Pay attention to the ReplayGain mode "auto" and the
replay_gain_missing_preamp parameter inside of decoder_replay_gain().
2010-05-18 20:39:32 +02:00
Daniel Seuthe
f824ecdfa1 replay_gain_config: added function replay_gain_get_real_mode() 2010-05-18 20:30:03 +02:00