From d645f0a97a52ac061d1f6a43b798c05df93fc48e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 28 Sep 2008 19:02:27 -0700 Subject: directory: update playlist version if updated If we updated the mpd metadata database; then there's a chance some of those songs in the playlist will have updated metadata. So be on the safe side and increment the playlist version number if _any_ song changed (this is how all released versions of mpd did it, too). This bug was introduced recently when making "update" threaded. Thanks to stonecrest for the bug report. --- src/directory.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/directory.c b/src/directory.c index ca6ef8666..f7c426267 100644 --- a/src/directory.c +++ b/src/directory.c @@ -123,9 +123,14 @@ int isUpdatingDB(void) void reap_update_task(void) { + enum update_return ret; + if (progress != UPDATE_PROGRESS_DONE) return; - pthread_join(update_thr, NULL); + if (pthread_join(update_thr, (void **)&ret)) + FATAL("error joining update thread: %s\n", strerror(errno)); + if (ret == UPDATE_RETURN_UPDATED) + playlistVersionChange(); progress = UPDATE_PROGRESS_IDLE; } -- cgit v1.2.3