From ef39da59731afd37f5e511caf1cf6ce71fd0d38b Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sat, 10 Dec 2011 18:37:45 -0800 Subject: configure/utils: Add ipv6 support for mingw build --- src/utils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils.c b/src/utils.c index 53494cc5d..6e85dd5ff 100644 --- a/src/utils.c +++ b/src/utils.c @@ -33,7 +33,11 @@ #include #endif -#ifdef HAVE_IPV6 +#if HAVE_IPV6 && WIN32 +#include +#endif + +#if HAVE_IPV6 && ! WIN32 #include #endif -- cgit v1.2.3 From f5d3859238538dba15d8a972594ad0a5a5f7edda Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sat, 10 Dec 2011 18:43:36 -0800 Subject: cmdline: Remove duplicate g_free()s --- src/cmdline.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/cmdline.c b/src/cmdline.c index 2c1db890b..d986c8eb8 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -194,8 +194,6 @@ parse_cmdline(int argc, char **argv, struct options *options, if(g_file_test(system_path, G_FILE_TEST_IS_REGULAR)) { ret = config_read_file(system_path,error_r); - g_free(system_path); - g_free(&system_config_dirs); break; } ++i;; -- cgit v1.2.3 From 533e4fcdadf70cc2899f8e93a1aadfb219693a9c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Dec 2011 20:08:31 +0100 Subject: decoder/mp4ff: work around assertion failure in read() callback This workaround leads to an infinite loop instead of an assertion failure, but hey, now it's libmp4ff's fault. --- src/decoder/mp4ff_decoder_plugin.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/decoder/mp4ff_decoder_plugin.c b/src/decoder/mp4ff_decoder_plugin.c index 861b08194..cd85778f8 100644 --- a/src/decoder/mp4ff_decoder_plugin.c +++ b/src/decoder/mp4ff_decoder_plugin.c @@ -94,6 +94,12 @@ mp4_read(void *user_data, void *buffer, uint32_t length) { struct mp4ff_input_stream *mis = user_data; + if (length == 0) + /* libmp4ff is known to attempt to read 0 bytes - make + this a special case, because the input_stream API + would not allow this */ + return 0; + return decoder_read(mis->decoder, mis->input_stream, buffer, length); } -- cgit v1.2.3 From 2ef7ee6ca7adcd66b00adf9e8de1c7adf29f371c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Dec 2011 20:26:24 +0100 Subject: update_walk: print debug message for song_file_load() --- src/update_walk.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/update_walk.c b/src/update_walk.c index 426bd62ff..03fa78456 100644 --- a/src/update_walk.c +++ b/src/update_walk.c @@ -616,6 +616,8 @@ update_regular_file(struct directory *directory, } if (song == NULL) { + g_debug("reading %s/%s", + directory_get_path(directory), name); song = song_file_load(name, directory); if (song == NULL) { g_debug("ignoring unrecognized file %s/%s", -- cgit v1.2.3 From 097e5dfbdc2ec958045d5f4b5ec5e7cfa396360e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Dec 2011 21:02:33 +0100 Subject: timer: fix time unit mixup in timer_delay() The local variable was already divided by 1000, and the return value was being divided by 1000 again - doh! This caused delays in the httpd output plugin that were too small by three orders of magnitude, and the buffer was filled too quickly. --- src/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/timer.c b/src/timer.c index 0b3b1198a..ba82fc522 100644 --- a/src/timer.c +++ b/src/timer.c @@ -81,7 +81,7 @@ timer_delay(const Timer *timer) if (delay > G_MAXINT) delay = G_MAXINT; - return delay / 1000; + return delay; } void timer_sync(Timer *timer) -- cgit v1.2.3 From 96ad5b84446be0bf603895adaf0ec2e97bee11aa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Dec 2011 21:32:19 +0100 Subject: output/openal: force 16 bit playback, as 8 bit doesn't work The OpenAL specification says that AL_FORMAT_MONO8 and AL_FORMAT_STEREO8 expect unsigned 8 bit samples, but MPD uses unsigned samples. --- src/output/openal_plugin.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/output/openal_plugin.c b/src/output/openal_plugin.c index 0a8f253b2..e5db8ac34 100644 --- a/src/output/openal_plugin.c +++ b/src/output/openal_plugin.c @@ -58,6 +58,10 @@ openal_output_quark(void) static ALenum openal_audio_format(struct audio_format *audio_format) { + /* note: cannot map SAMPLE_FORMAT_S8 to AL_FORMAT_STEREO8 or + AL_FORMAT_MONO8 since OpenAL expects unsigned 8 bit + samples, while MPD uses signed samples */ + switch (audio_format->format) { case SAMPLE_FORMAT_S16: if (audio_format->channels == 2) @@ -69,16 +73,6 @@ openal_audio_format(struct audio_format *audio_format) audio_format->channels = 1; return openal_audio_format(audio_format); - case SAMPLE_FORMAT_S8: - if (audio_format->channels == 2) - return AL_FORMAT_STEREO8; - if (audio_format->channels == 1) - return AL_FORMAT_MONO8; - - /* fall back to mono */ - audio_format->channels = 1; - return openal_audio_format(audio_format); - default: /* fall back to 16 bit */ audio_format->format = SAMPLE_FORMAT_S16; -- cgit v1.2.3