db/proxy: use mpd_song_get_{start,end}() only with libmpdclient >= 2.3

This commit is contained in:
Max Kellermann
2014-06-23 08:57:51 +02:00
parent 4f61ba766d
commit 4c8a5dfb05
2 changed files with 7 additions and 0 deletions

View File

@@ -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));