From 40851b7cac34abb708d12ce5bf110ffb15af6819 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 29 Jun 2009 22:20:36 +0200 Subject: 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. --- src/output_all.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/output_all.c b/src/output_all.c index c6fb0f481..4b5ba3a6f 100644 --- a/src/output_all.c +++ b/src/output_all.c @@ -439,8 +439,6 @@ audio_output_all_cancel(void) { unsigned int i; - audio_output_all_update(); - /* send the cancel() command to all audio outputs */ for (i = 0; i < num_audio_outputs; ++i) { -- cgit v1.2.3 From 1937d29228a9727fb76faeffd66a74c6167238e0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 29 Jun 2009 22:20:46 +0200 Subject: output_thread: don't play next chunk after command==PAUSE When the PAUSE loop ends, re-check the next command before calling ao_play() again. --- src/output_thread.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/output_thread.c b/src/output_thread.c index acedd863e..d414ba8d5 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -246,7 +246,11 @@ static gpointer audio_output_task(gpointer arg) case AO_COMMAND_PAUSE: ao_pause(ao); - break; + /* don't "break" here: this might cause + ao_play() to be called when command==CLOSE + ends the paused state - "continue" checks + the new command first */ + continue; case AO_COMMAND_CANCEL: ao->chunk = NULL; -- cgit v1.2.3 From 15d4c841ce8b5b387850d710999c623b038910fa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 30 Jun 2009 16:29:40 +0200 Subject: 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. --- src/database.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/database.c b/src/database.c index 7257930bc..5a06dda98 100644 --- a/src/database.c +++ b/src/database.c @@ -318,10 +318,11 @@ db_load(GError **error) if (old_charset != NULL && strcmp(new_charset, old_charset)) { fclose(fp); - g_message("Existing database has charset \"%s\" " - "instead of \"%s\"; " - "discarding database file", - new_charset, old_charset); + g_set_error(error, db_quark(), 0, + "Existing database has charset " + "\"%s\" instead of \"%s\"; " + "discarding database file", + new_charset, old_charset); return false; } } else { -- cgit v1.2.3 From badb827712f14a811483ed542b2c2cf09e650cce Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 5 Jul 2009 07:14:24 +0200 Subject: 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(). --- src/log.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/log.c b/src/log.c index b7c6b9bb0..94691ab64 100644 --- a/src/log.c +++ b/src/log.c @@ -259,12 +259,8 @@ void log_init(bool verbose, bool use_stdout) log_init_syslog(); #endif } else { - char *path = parsePath(param->value); - g_free(param->value); - - if (path == NULL) - g_error("error parsing \"%s\" at line %i\n", - CONF_LOG_FILE, param->line); + const char *path = config_get_path(CONF_LOG_FILE); + assert(path != NULL); log_init_file(path, param->line); } -- cgit v1.2.3 From 00eea0e61509847d52c6e7c328c526cd8ea21f5e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Jul 2009 11:32:31 +0200 Subject: song: initialize mtime in song_alloc() --- src/song.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/song.c b/src/song.c index f7eee54a2..76c25f44f 100644 --- a/src/song.c +++ b/src/song.c @@ -49,6 +49,7 @@ song_alloc(const char *url, struct directory *parent) song->tag = NULL; memcpy(song->url, url, urllen + 1); song->parent = parent; + song->mtime = 0; return song; } -- cgit v1.2.3 From 64ca94c91020626edf626a7e639e168dba9e7d74 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Jul 2009 14:40:06 +0200 Subject: 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. --- src/output/httpd_output_plugin.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c index 02fa1cf17..edfc1063d 100644 --- a/src/output/httpd_output_plugin.c +++ b/src/output/httpd_output_plugin.c @@ -28,6 +28,7 @@ #include +#include #include #include #include -- cgit v1.2.3 From c0c5119788c24832ee548df7f3f72742c878e906 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Jul 2009 22:09:30 +0200 Subject: 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. --- src/decoder/flac_plugin.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c index 965a8b46b..1d7a9f868 100644 --- a/src/decoder/flac_plugin.c +++ b/src/decoder/flac_plugin.c @@ -394,6 +394,7 @@ flac_decode_internal(struct decoder * decoder, if (!(flac_dec = flac_new())) return; flac_data_init(&data, decoder, input_stream); + data.tag = tag_new(); #if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7 if(!FLAC__stream_decoder_set_metadata_respond(flac_dec, FLAC__METADATA_TYPE_VORBIS_COMMENT)) @@ -422,8 +423,6 @@ flac_decode_internal(struct decoder * decoder, } } - data.tag = tag_new(); - if (!flac_process_metadata(flac_dec)) { err = "problem reading metadata"; goto fail; -- cgit v1.2.3 From 58dd6eee5d95e0d836b953c9e587651c2cb53008 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Jul 2009 14:23:44 +0200 Subject: output/httpd: removed duplicate sys/types.h include The first patch by Patrick didn't work, because his "#ifdef HAVE_OSX" line would have required config.h. --- src/output/httpd_output_plugin.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c index edfc1063d..9fdf46456 100644 --- a/src/output/httpd_output_plugin.c +++ b/src/output/httpd_output_plugin.c @@ -34,10 +34,6 @@ #include #include -#ifdef HAVE_OSX -#include -#endif - #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "httpd_output" -- cgit v1.2.3