Commit Graph

204 Commits

Author SHA1 Message Date
Max Kellermann 23e46b38ca mapper: fix memory leak when playlist_directory is not set
Don't allocate the file name before the playlist_dir==NULL check.
2009-12-08 08:06:10 +01:00
svitoos 7162fe85ce tag_id3: fix ID3v1 charset conversion
If we define id3v1_encoding, then the tags are not added to the
database.
2009-11-30 17:42:46 +01:00
Max Kellermann 16123f1b8e ffmpeg: don't try to force stereo
The plugin code tried to force libavcodec to supply stereo samples.
That however has never actually worked.  By removing this code, we are
able to play surround files for the first time.
2009-11-30 09:59:05 +01:00
Avuton Olrich d1aee3ae74 Modify version string to post-release version 0.15.7~git 2009-11-18 18:49:25 -08:00
Avuton Olrich 30847e6c77 mpd version 0.15.6 2009-11-18 18:49:25 -08:00
Max Kellermann 97f8e017c4 decoder/flac: fixed NULL pointer dereference in CUE code
The function flac_vtrack_tnum() was missing a strrchr()==NULL check.
2009-11-18 19:55:38 +01:00
Max Kellermann f51ba6464a id3: allow 4 MB RIFF/AIFF tags
Allow RIFF/AIFF ID3 tags up to 4 MB (old limit was 256 kB).  This
might still be too small for some users, and when somebody complains,
we might do something more clever (like streaming the data into
libid3tag?).
2009-11-15 18:44:53 +01:00
Max Kellermann 77b95d08a5 decoder/ffmpeg: align the output buffer
On some platforms, libavcodec wants the output buffer aligned to 16
bytes (because it uses SSE/Altivec internally).  It will segfault when
you don't obey this rule.
2009-11-15 17:39:09 +01:00
Max Kellermann dca4d9cf83 decoder/flac: fixed CUE seeking range check
If flac_container_decode() gets a seek destination which is out of
range, it ignores the SEEK command (never finishes it).  This leads to
MPD lockup, because the player thread waits for completion.
2009-11-11 08:55:55 +01:00
Max Kellermann 68f77e4163 oggflac: rewind stream after FLAC detection
The oggflac plugin has been completely broken for quite a while and
nobody has noticed - maybe we should remove it?
2009-11-11 08:14:37 +01:00
Max Kellermann 93a13b42dd zzip: require libzzip 0.13
We need the function zzip_file_stat().
2009-11-10 21:00:10 +01:00
Max Kellermann 96fcf5e1a5 input/mms: require libmms 0.4
We're using API functions which are not available in 0.3.
2009-11-10 20:57:10 +01:00
Max Kellermann 937b2b1744 sticker: added fallback for sqlite3_prepare_v2()
This function was not present in SQLite < 3.4.
2009-11-10 20:55:29 +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 b242175e18 song_save: increased maximum line length to 32 kB
The line buffer had a fixed size of 5 kB, and was allocated on the
stack.  This was too small for some users.  As a hotfix, we're
increasing the buffer size to 32 kB now, allocated on the heap.  In
MPD 0.16, we'll switch to dynamic allocation.
2009-11-01 15:27:55 +01:00
Max Kellermann 04816a6369 decoder/ffmpeg: convert metadata
Convert the metadata with the libavformat function av_metadata_conv().
This ensures that canonical tag names are provided by libavformat, and
we can remove the "artist" vs "author" workaround.
2009-10-28 22:12:22 +01:00
Max Kellermann d083032236 update: delete ignored symlinks from database
When you disable the "follow_outside_symlinks" or the
"follow_inside_symlinks" setting, the next update should remove the
now-ignored files from the database.
2009-10-27 22:06:28 +01:00
Max Kellermann 1a6ed81193 output_thread: check again if output is open on PAUSE
Basically the same as the 0.15.5 patch "check again if output is open
on CANCEL".  Same race condition, same fix.
2009-10-21 08:07:07 +02:00
Avuton Olrich b2b300b635 Modify version string to post-release version 0.15.6~git 2009-10-18 09:50:17 -07:00
Avuton Olrich 7df1a2c77d mpd version 0.15.5 2009-10-18 09:50:16 -07:00
Max Kellermann d09e19c3dc decoder/flac: fixed two memory leaks in the CUE tag loader
Don't initialize "vc" and "cs" with FLAC__metadata_object_new(); that
value is overwritten by FLAC__metadata_get_tags() and
FLAC__metadata_get_cuesheet().
2009-10-16 17:39:17 +02:00
Max Kellermann 8ae5bc4d79 update: fixed memory leak during container scan
The return value of map_directory_child_fs() must be freed.
2009-10-16 17:38:15 +02:00
Max Kellermann 2c908fde1b output_thread: check again if output is open on CANCEL
When the player thread unpauses, it sends CANCEL to the output thread,
after having checked that the output is still open.  Problem is when
the output thread closes the device before it can process the CANCEL
command - race condition.  This patch adds another "open" check inside
the output thread.
2009-10-16 15:09:22 +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 9a3f5ff977 riff, aiff: fixed "limited range" gcc warning
On 32 bit systems with large file support enabled (i.e. "sizeof(off_t)
> sizeof(size_t)") gcc emits a warning because a size_t cast to off_t
can never become negative.
2009-10-11 23:15:38 +02:00
Max Kellermann a1d868eb56 decoder_thread: change the fallback decoder name to "mad"
When there is no Content-Type response header, try the "mad" decoder
plugin.  It uesd to be named "mp3", and we forgot to change the
fallback name in decoder_thread.c.
2009-10-11 23:14:16 +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
Avuton Olrich d6d4de1123 Modify version string to post-release version 0.15.5~git 2009-10-03 05:44:26 -07:00
Avuton Olrich 325e380b8e mpd version 0.15.4 2009-10-03 05:44:26 -07:00
Max Kellermann 65693d057b decoder/ffmpeg: use the "artist" tag if "author" is not present
Usually, we read our "artist" tag from ffmpeg's "author" tag.  In some
cases however (e.g. APE), this tag is named "artist".  This patch
implements a fallback: if no "author" is found, MPD tries to use
"artist".
2009-09-30 15:41:43 +02:00
Max Kellermann b0f9a1454a decoder/faad: skip assertion failure on large ID3 tags
When the ID3 tag in an AAC file is larger than the current buffer, the
function decoder_buffer_consume() aborts.  By using the new function
decoder_buffer_skip() instead, we can safely skip the ID3 tag.
2009-09-30 15:22:47 +02:00
Patrik Weiskircher 803a698f98 output/osx: fix the OS X 10.6 build
Include CoreServices/CoreServices.h.
2009-09-20 23:28:07 +02:00
Max Kellermann a99202a8a4 decoder/vorbis: revert "faster tag scanning with ov_test_callback()"
This patch made ov_time_total() unusable, and MPD did not know the
duration of songs.
2009-09-10 23:04:01 +02:00
Avuton Olrich e8569af35f Modify version string to post-release version 0.15.4~git 2009-08-29 22:59:24 -07:00
Avuton Olrich 7a690c6b70 mpd version 0.15.3 2009-08-29 22:59:24 -07:00
Rasmus Steinke 408f723701 decoder/vorbis: faster tag scanning with ov_test_callback()
using ov_test_callback with function CALLBACKS_STREAMONLY will cause
scanning to stop after the comment field.  ov_open (and ov_test)
default to CALLBACKS_DEFAULT which scans the file structure causing a
huge slowdown.  The speed improvement is huge: It scanned my files
around 10x faster This procedure has been recommended by monthy (main
vorbis developer) and was said to be safe for scanning files.
2009-08-24 22:14:22 +02:00
Igor Kuzmin 9d42f4e0ed update: don't re-read unchanged container files
MPD checks if every flac (possibly other types as well) file contains
cuesheet on every update, which produces unneeded I/O. My music
collection is on NFS share, so it's quite noticeable. IMHO, it
shouldn't re-read unchanged files, so I wrote simple patch to fix it.
2009-08-19 21:21:29 +02:00
Max Kellermann fd8aa54a90 output_init: initialize the "pause" flag
Fix stuttering due to uninitialized variable.
2009-08-18 11:32:54 +02:00
Avuton Olrich 48a80d0b85 Modify version string to post-release version 0.15.3~git 2009-08-15 11:57:50 -07:00
Avuton Olrich 5715534b53 mpd version 0.15.2 2009-08-15 11:57:50 -07:00
Max Kellermann f38ce5408b output/shout: minimize the unpause latency
During the pause loop, manually sleep for 500ms if shout_delay()
returns a value greater than that.  Don't exhaust libshout's buffer.
2009-08-14 11:52:36 +02:00
Max Kellermann 7133f560ec output: fixed shout stuck pause bug
Explicitly make the output thread leave the ao_pause() loop.  This
patch is a workaround, and the "pause" flag is not managed in a
thread-safe way, but that's good enough for now.
2009-08-14 11:52:12 +02:00
Max Kellermann 7dddd9beda directory: free empty directories after removing them (memleak)
dirvec_delete() does not free the object, we have to call
directory_free() afterwards.
2009-08-14 11:52:00 +02:00
Max Kellermann 5d6f7803e1 update: free temporary string in container scan (memleak)
The return value of map_directory_child_fs() must be freed.
2009-08-14 11:51:51 +02:00
Max Kellermann 1c4f407a6d decoder/flac: don't allocate cuesheet twice (memleak)
The function flac_cue_track() first calls FLAC__metadata_object_new(),
then overwrites this pointer with FLAC__metadata_get_cuesheet().  This
allocate two FLAC__StreamMetadata objects, but the first pointer is
lost, and never freed.
2009-08-14 11:51:42 +02:00
Max Kellermann e44f313912 update: free empty path string (memleak)
When you pass an empty string to directory_update_init(), it was not
freed by update_task().
2009-08-14 11:51:35 +02:00
Max Kellermann 47ed89bd4c decoder/flac: parse all replaygain tags
The FLAC replaygain parser used the "||" operator.  This made the code
stop after the first value which was found.
2009-07-22 13:31:48 +02:00
Max Kellermann 322ef3cb80 mad: skip ID3 frames when libid3tag is disabled
When libid3tag is disabled, the libmad decoder plugin is unable to
identify ID3 frames.  If the file starts with an (unidentified) ID3
frame, it assumes that the file is not a valid MP3 song.  This patch
solves this by adding minimal stubs for the ID3 functions.
2009-07-22 12:57:03 +02:00
Max Kellermann 0ce727d5d4 ape: added protection against large memory allocations
The function tag_ape_load() retrieves a 32 bit unsigned integer from
the input file, and passes it to g_malloc().  This is dangerous, and
may be used for a denial of service attack on MPD.
2009-07-19 17:38:46 +02:00
Max Kellermann a988b9b025 ape: check the tag size (fixes integer underflow)
The expression "tagLen - size > 0" may result in an integer underflow
and a buffer overflow, when "size" is larger than "tagLen".  "size" is
read from the input file, and must not be trusted.  This patch changes
the expression to "tagLen > size", which is a lot safer.
2009-07-18 22:45:56 +02:00
Avuton Olrich 19f1bfdf40 Modify version string to post-release version 0.15.2~git 2009-07-15 13:36:41 -07:00
Avuton Olrich d7bad6ae02 mpd version 0.15.1 2009-07-15 13:36:41 -07:00
Max Kellermann 966a886ef5 NEWS: fixed typo 2009-07-14 14:24:02 +02:00
Max Kellermann c0c5119788 decoder/flac: fix assertion failure in tag_free() call
Initialize flac_data.tag right after flac_data_init().  This way, the
"goto fail" won't jump to the point where tag_free(NULL) can be
called.
2009-07-06 22:09:30 +02:00
Max Kellermann 64ca94c910 output/httpd: include sys/types.h
On Mac OS X, the httpd plugin cannot be compiled, because OS X's
system headers do nto include sys/types.h, although they use
u_int32_t.
2009-07-06 14:40:06 +02:00
Max Kellermann badb827712 log: fix double free() bug during shutdown
Don't free an internal configuration value in log_init().  Call
config_get_path() instead of manually calling parsePath().
2009-07-05 07:14:24 +02:00
Max Kellermann 15d4c841ce database: fixed NULL pointer dereference after charset change
When the filesystem_charset is changed in mpd.conf, MPD should discard
the old database.  In this error branch, MPD did not fill the GError
object properly, and logged a warning message instead, which caused a
segmentation fault.
2009-06-30 16:29:40 +02:00
Max Kellermann 40851b7cac output_all: don't resume playback when stopping during pause
When MPD was paused, and the client sent the "stop" command (or
"clear"), a glitch caused MPD to continue playback for a split second.
This was because audio_output_all_cancel() calls
audio_output_all_update(), which reopens all output devices, and
re-ignites the playback loop.
2009-06-29 22:20:36 +02:00
Max Kellermann f8f5d40532 NEWS: updated NEWS file for 0.15.1 2009-06-25 11:29:08 +02:00
Avuton Olrich 8758e97794 mpd version 0.15 2009-06-23 18:43:57 -07:00
Max Kellermann d5ddecb15a listen: bind() failure on secondary address is non-fatal
Several users had problems with binding MPD to "localhost".  The cause
was duplicate /etc/hosts entries: the resolver library returns
127.0.0.1 twice, and of course, MPD attempts to bind to "both" of
them.  This patch makes failures non-fatal, given that at least one
address was bound successfully.  This is a workaround; users should
rather fix their /etc/hosts file.
2009-06-10 08:01:07 +02:00
Daniel Kahn Gillmor 05dfdfdb39 alsa_mixer: add mixer_index option
This allows you to select controls with duplicate names.
2009-04-28 09:15:48 +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
Max Kellermann 472b994779 player_thread: pause when all audio outputs fail to play
When all audio outputs have been closed due to failures, pause the
playback instead of stopping it.  This way, the user may resume
at the current position after the problem has been dealt with.
2009-04-25 11:55:36 +02:00
Max Kellermann 54863dff8a NEWS: flagged some new features "experimental"
The "lastfm" input plugin is far from complete, because MPD does not
support nesting playlists yet.  The "fluidsynth" decoder plugin
suffers from shortcomings in the libfluidsynth library:

 http://www.mail-archive.com/fluid-dev@nongnu.org/msg01099.html
2009-04-02 07:12:38 +02:00
Avuton Olrich 88362cbcca news: add more miscellaneous missing news 2009-04-01 06:05:57 -07:00
Avuton Olrich be044ee1a2 news: move supports a range 2009-04-01 06:05:46 -07:00
Avuton Olrich c59ca49e6a news: add pulseaudio mixer 2009-04-01 06:05:35 -07:00
Avuton Olrich 8c1465c67c news: Add consume and single commands 2009-04-01 06:05:16 -07:00
Avuton Olrich ac8def81ab news: trivial modification to make the date line the same as the others 2009-03-31 20:01:26 -07:00
Max Kellermann f5548a8654 mpcdec: support the new libmpcdec SV8 API 2009-03-27 19:51:59 +01:00
Max Kellermann bba127a392 solaris: new audio output plugin for Solaris /dev/audio 2009-03-16 09:55:10 +01:00
Max Kellermann e12140cfce pcm_resample: choose the fallback resampler at runtime
Even if libsamplerate support is enabled, compile the fallback
resampler.  When the user specifies the option
"samplerate_converter=internal", it is chosen in favor of
libsamplerate.  This may help users with a weak FPU who don't want to
compile a custom MPD from source, because the fallback resampler does
not use floating point operations.
2009-03-14 15:26:36 +01:00
Max Kellermann 538701e7c6 player_thread: fill buffer after seeking
After a seek, wait until enough new chunks are decoded before starting
playback.  If this takes too long, send silence chunks to the audio
outputs meanwhile.
2009-03-10 21:19:51 +01:00
Max Kellermann 71e88271d9 output_thread: wait 10 seconds before reopening after play failure
This is similar to the MPD 0.14 patch "wait 10 seconds before
reopening a failed device", which only covered open() failures.  This
patch adds the same feature for play().
2009-03-09 19:08:35 +01:00
Max Kellermann 554a34fb95 alsa: better period_time default value for high sample rates
The default values for buffer_time and period_time were both capped by
the hardware limits on practically all chips.  The result was a
period_time which was half as big as the buffer_time.  On some chips,
this led to lots of underruns when using a high sample rate (192 kHz),
because MPD had very little time to send new samples to ALSA.

A period time which is one fourth of the buffer time turned out to be
much better.  If no period_time is configured, see how much
buffer_time the hardware accepts, and try to configure one fourth of
it as period_time, instead of hard-coding the default period_time
value.

This is yet another attempt to provide a solution which is valid for
all sound chips.  Using the SND_PCM_NONBLOCK flag also seemed to solve
the underruns, but put a lot more CPU load to MPD.
2009-03-08 03:55:01 +01:00
Avuton Olrich e7f034dcef cmdline: Print available protocols when --version is run. 2009-03-03 21:25:19 +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 336f624277 tag_id3: parse ID3 tags in RIFF/WAV files
Added a small RIFF parser library.  Look for an "id3" chunk, and let
libid3tag parse it.
2009-03-02 18:00:46 +01:00
Max Kellermann 062f37071c audio_format: allow 32 bit samples
This is the first patch in a series to enable 32 bit audio samples in
MPD.  32 bit samples are more tricky than 24 bit samples, because the
integer may overflow when you operate on a sample.
2009-03-02 15:46:09 +01:00
Max Kellermann ba3a8474b6 flac: parse stream tags
Parse the vorbis comments in libflac's metadata_callback and pass them
as tag struct to the decoder API.
2009-03-01 14:07:23 +01:00
Max Kellermann af66f666c6 audiofile: added 24 bit support
Don't hard code the "bits" parameter to 16.  Try to use the input's
sample format, if possible.
2009-03-01 10:53:46 +01:00
Max Kellermann a5c09c91c4 output: added option to disable audio outputs by default
The option "enabled" is on by default.  If you specify "enabled no" in
an audio_output section, then this device is disabled by default.
2009-02-28 19:40:39 +01:00
Michal Nazarewicz cabbf7ab4a pipe: new audio output plugin which runs a command
[mk: adapted to new output plugin API]
2009-02-28 16:11:59 +01:00
Max Kellermann 1bb0124b77 listen: allocate sockaddr_storage struct for accept()
The generic sockaddr struct is too small for some addresses.  For
accept(), we have to allocate a sockaddr_storage struct on the stack,
which is large enough for all addresses.
2009-02-28 15:20:35 +01:00
Max Kellermann eae0287466 song_print: hide HTTP password in playlist
Added the uri_remove_auth() library function which strips username
and password from a HTTP URI, and use it in song_print_url().  This
allows you to add HTTP URIs to the playlist including secret username
and password, without disclosing it to all MPD clients.
2009-02-27 19:20:11 +01:00
Max Kellermann dfea6b7cdd mvp: fixed default device detection
The check "open()!=0" is wrong, you have to write "open()>=0", because
-1 means error, and 0 is a valid file handle.
2009-02-26 22:10:58 +01:00
Max Kellermann d3409a65b5 mvp: check for reopen errors
When the MVP device has been closed in the cancel() method, and the
play() method attempts to reopen it, check for errors.
2009-02-25 21:57:02 +01:00
Max Kellermann 99f535ad77 mvp: fall back to 16 bit audio samples
Looks like the MVP audio output only supports 16 and 24 bit audio
samples.  If MPD generates any other sample formats, force it to use
16 bit.
2009-02-25 21:52:11 +01:00
Max Kellermann 8491f61d6c mvp: fall back to stereo
When the channel count is greater than 2, fall back to stereo sound.
2009-02-25 21:51:39 +01:00
Max Kellermann 1f88cd73d4 decoder_list: added configuration option to disable decoder plugins 2009-02-15 18:40:47 +01:00
Max Kellermann 98994c5939 daemon: ignore "user" setting if already running as that user
If mpd.conf specifies a user, and MPD is invoked by exactly this user,
ignore the "user" setting.  Don't bother to look up its groups and
don't attempt to change uid, it won't work anyway.
2009-02-15 16:47:21 +01:00
Avuton Olrich fd69782a99 mpd version 0.14.2 2009-02-14 19:34:57 +01:00
Max Kellermann df9245c2aa update: free deleted subdirectories
Use delete_directory() for removing sub directories instead of
dirvec_clear().  This ensures that all memory occupied by
subdirectories of deleted directories is freed.
2009-02-12 19:12:32 +01:00
Max Kellermann 16bab6019b update: recursively purge deleted directories
When a directory is deleted, MPD deleted only the directory from the
database; it did not bother to walk the full tree to free all memory
and to remove deleted songs from the playlist.  Replace a
dirvec_delete() with delete_directory().
2009-02-12 19:12:25 +01:00
Max Kellermann a06e281421 aac: fix stream metadata
Pass the input_stream object to decoder_data().  Without it, the MPD
core does not see stream tags.
2009-02-12 18:39:19 +01:00
Max Kellermann 1492339463 wildmidi: new decoder plugin for MIDI files 2009-02-12 16:43:18 +01:00
Max Kellermann e56a90f3b3 fluidsynth: new decoder plugin for MIDI files
There are a few problems left in this plugin:

- fluidsynth decodes in real time, while MPD prefers to buffer as
  quickly as possible; as a workaround, this plugin uses a timer
  object to synchronize with real-time playback

- I don't know yet how fluidsynth tells me when the song has ended

- the "soundfont" configuration setting is not yet documented, and it
  will likely change soon (in favor of a per-decoder configuration
  block)
2009-02-12 08:43:26 +01:00
Max Kellermann 1136f6fb7a sidplay: new decoder plugin for playing C64 SID files 2009-02-11 20:31:17 +01:00
Max Kellermann 550b9c3f23 ffmpeg: added TTA support
The ffmpeg library supports the "True Audio Codec".  The entry in
ffmpeg_suffixes was missing.
2009-02-11 18:27:11 +01:00