From 81bdc3f625ecce1eca87009caf89e98abd405f51 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Oct 2008 11:06:27 +0200 Subject: song: use song_file_update() in song_file_load() Eliminate duplicated code. --- src/song.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src') diff --git a/src/song.c b/src/song.c index 09a92223c..18f2bca21 100644 --- a/src/song.c +++ b/src/song.c @@ -61,10 +61,6 @@ struct mpd_song * song_file_new(const char *path, struct directory *parent) struct mpd_song * song_file_load(const char *path, struct directory *parent) { struct mpd_song *song; - unsigned int next = 0; - InputPlugin *plugin; - char path_max_tmp[MPD_PATH_MAX]; - char *abs_path; if (strchr(path, '\n')) { DEBUG("song_file_load: '%s' is not a valid uri\n", path); @@ -72,13 +68,7 @@ struct mpd_song * song_file_load(const char *path, struct directory *parent) } song = song_file_new(path, parent); - abs_path = rmp2amp_r(path_max_tmp, song_get_url(song, path_max_tmp)); - - while (!song->tag && - (plugin = isMusic(abs_path, &song->mtime, next++))) { - song->tag = plugin->tagDupFunc(abs_path); - } - if (!song->tag || song->tag->time < 0) { + if (!song_file_update(song)) { song_free(song); return NULL; } -- cgit v1.2.3