aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/UpnpDatabasePlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-22 23:28:23 +0100
committerMax Kellermann <max@duempel.org>2014-01-22 23:28:23 +0100
commitb74aa6b14c74d0ab4a574b9affcac82535653a1e (patch)
tree529ce3df106420f700be9e0bf6fdaa450242a6bc /src/db/UpnpDatabasePlugin.cxx
parent0c4a791111905df86a604261e331b29a1ee8b1ed (diff)
downloadmpd-b74aa6b14c74d0ab4a574b9affcac82535653a1e.tar.gz
mpd-b74aa6b14c74d0ab4a574b9affcac82535653a1e.tar.xz
mpd-b74aa6b14c74d0ab4a574b9affcac82535653a1e.zip
db/upnp: don't duplicate song data for VisitSong
Not necessary because we control the LightSong's life cycle.
Diffstat (limited to 'src/db/UpnpDatabasePlugin.cxx')
-rw-r--r--src/db/UpnpDatabasePlugin.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx
index b746e28cb..69a9003d7 100644
--- a/src/db/UpnpDatabasePlugin.cxx
+++ b/src/db/UpnpDatabasePlugin.cxx
@@ -350,14 +350,21 @@ UpnpDatabase::SearchSongs(ContentDirectoryService &server,
}
static bool
-visitSong(UPnPDirObject &&meta, std::string &&path,
+visitSong(const UPnPDirObject &meta, std::string &&path,
const DatabaseSelection &selection,
VisitSong visit_song, Error& error)
{
if (!visit_song)
return true;
- const UpnpSong song(std::move(meta), std::move(path));
+ LightSong song;
+ song.directory = nullptr;
+ song.uri = path.c_str();
+ song.real_uri = meta.url.c_str();
+ song.tag = &meta.tag;
+ song.mtime = 0;
+ song.start_ms = song.end_ms = 0;
+
return !selection.Match(song) || visit_song(song, error);
}