aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-03-16 06:52:46 +0000
committerEric Wong <normalperson@yhbt.net>2006-03-16 06:52:46 +0000
commit69635022133488e6b19569fb59b16c4658a244eb (patch)
treea7149e6a5a82017ae3821c801433c8794f796aec /src/song.c
parentd7e846bdc2d848525ebd4251c4c5d9c5fe0d2705 (diff)
downloadmpd-69635022133488e6b19569fb59b16c4658a244eb.tar.gz
mpd-69635022133488e6b19569fb59b16c4658a244eb.tar.xz
mpd-69635022133488e6b19569fb59b16c4658a244eb.zip
merge with mpd/trunk up to r3925
git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/song.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/song.c b/src/song.c
index 9a2c8d67d..07a7e04fb 100644
--- a/src/song.c
+++ b/src/song.c
@@ -64,9 +64,12 @@ Song * newSong(char * url, int type, Directory * parentDir) {
if(song->type == SONG_TYPE_FILE) {
InputPlugin * plugin;
- if((plugin = isMusic(getSongUrl(song), &(song->mtime)))) {
- song->tag = plugin->tagDupFunc(
- rmp2amp(utf8ToFsCharset(getSongUrl(song))));
+ unsigned int next = 0;
+ char * song_url = getSongUrl(song);
+ char * abs_path = rmp2amp(utf8ToFsCharset(song_url));
+ while(!song->tag && (plugin = isMusic(song_url,
+ &(song->mtime), next++))) {
+ song->tag = plugin->tagDupFunc(abs_path);
}
if(!song->tag || song->tag->time<0) {
freeSong(song);
@@ -100,7 +103,7 @@ Song * addSongToList(SongList * list, char * url, char * utf8path,
switch(songType) {
case SONG_TYPE_FILE:
- if(isMusic(utf8path, NULL)) {
+ if(isMusic(utf8path, NULL, 0)) {
song = newSong(url, songType, parentDirectory);
}
break;
@@ -278,14 +281,17 @@ void readSongInfoIntoList(FILE * fp, SongList * list, Directory * parentDir) {
int updateSongInfo(Song * song) {
if(song->type == SONG_TYPE_FILE) {
InputPlugin * plugin;
+ unsigned int next = 0;
+ char * song_url = getSongUrl(song);
+ char * abs_path = rmp2amp(song_url);
if(song->tag) freeMpdTag(song->tag);
song->tag = NULL;
- if((plugin = isMusic(getSongUrl(song),&(song->mtime)))) {
- song->tag = plugin->tagDupFunc(
- rmp2amp(getSongUrl(song)));
+ while(!song->tag && (plugin = isMusic(song_url,
+ &(song->mtime), next++))) {
+ song->tag = plugin->tagDupFunc(abs_path);
}
if(!song->tag || song->tag->time<0) return -1;
}