From b74aa6b14c74d0ab4a574b9affcac82535653a1e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 22 Jan 2014 23:28:23 +0100 Subject: db/upnp: don't duplicate song data for VisitSong Not necessary because we control the LightSong's life cycle. --- src/db/UpnpDatabasePlugin.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3