db/upnp: don't duplicate song data for VisitSong

Not necessary because we control the LightSong's life cycle.
This commit is contained in:
Max Kellermann 2014-01-22 23:28:23 +01:00
parent 0c4a791111
commit b74aa6b14c

View File

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