aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-06-23 08:57:51 +0200
committerMax Kellermann <max@duempel.org>2014-06-23 09:17:35 +0200
commit4c8a5dfb0522b0ff7d6acb96fd2fbc33c22c14e6 (patch)
treee9e80fa985a022476cf1206d618592f2034d4591
parent4f61ba766d5e3e94df3584d7e33e9a9f4452ca67 (diff)
downloadmpd-4c8a5dfb0522b0ff7d6acb96fd2fbc33c22c14e6.tar.gz
mpd-4c8a5dfb0522b0ff7d6acb96fd2fbc33c22c14e6.tar.xz
mpd-4c8a5dfb0522b0ff7d6acb96fd2fbc33c22c14e6.zip
db/proxy: use mpd_song_get_{start,end}() only with libmpdclient >= 2.3
-rw-r--r--NEWS2
-rw-r--r--src/db/ProxyDatabasePlugin.cxx5
2 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 0bd6899df..5375d1395 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
ver 0.18.12 (not yet released)
+* database
+ - proxy: fix build failure with libmpdclient 2.2
ver 0.18.11 (2014/05/12)
* decoder
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx
index 00b5d445f..e41ecdec0 100644
--- a/src/db/ProxyDatabasePlugin.cxx
+++ b/src/db/ProxyDatabasePlugin.cxx
@@ -398,8 +398,13 @@ Convert(const struct mpd_song *song)
Song *s = Song::NewDetached(mpd_song_get_uri(song));
s->mtime = mpd_song_get_last_modified(song);
+
+#if LIBMPDCLIENT_CHECK_VERSION(2,3,0)
s->start_ms = mpd_song_get_start(song) * 1000;
s->end_ms = mpd_song_get_end(song) * 1000;
+#else
+ s->start_ms = s->end_ms = 0;
+#endif
TagBuilder tag;
tag.SetTime(mpd_song_get_duration(song));