aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cmdline.c2
-rw-r--r--src/decoder/mp4ff_decoder_plugin.c6
-rw-r--r--src/output/openal_output_plugin.c14
-rw-r--r--src/timer.c2
-rw-r--r--src/update_walk.c2
-rw-r--r--src/utils.c6
6 files changed, 18 insertions, 14 deletions
diff --git a/src/cmdline.c b/src/cmdline.c
index 45e361e71..8ab317730 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;;
diff --git a/src/decoder/mp4ff_decoder_plugin.c b/src/decoder/mp4ff_decoder_plugin.c
index 6475211a4..89f65670e 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);
}
diff --git a/src/output/openal_output_plugin.c b/src/output/openal_output_plugin.c
index 622cf559e..0b98dae84 100644
--- a/src/output/openal_output_plugin.c
+++ b/src/output/openal_output_plugin.c
@@ -61,6 +61,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)
@@ -72,16 +76,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;
diff --git a/src/timer.c b/src/timer.c
index bbc7a4ab9..691ab76be 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -81,7 +81,7 @@ timer_delay(const struct timer *timer)
if (delay > G_MAXINT)
delay = G_MAXINT;
- return delay / 1000;
+ return delay;
}
void timer_sync(struct timer *timer)
diff --git a/src/update_walk.c b/src/update_walk.c
index 1fabc8682..0feedd0ae 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",
diff --git a/src/utils.c b/src/utils.c
index d3b21d369..a2de3212e 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -34,7 +34,11 @@
#include <pwd.h>
#endif
-#ifdef HAVE_IPV6
+#if HAVE_IPV6 && WIN32
+#include <winsock2.h>
+#endif
+
+#if HAVE_IPV6 && ! WIN32
#include <sys/socket.h>
#endif